S
S
Sergey Zhuzhgov2012-06-16 18:19:55
PHP
Sergey Zhuzhgov, 2012-06-16 18:19:55

Obtaining a user id through the Vkontakte application

How to get the ID of the Vkontakte user who is viewing the application so that the ID is saved when navigating through the pages within the application.
I found examples on the net, but they show the identifier only when entering the application, and when you go to another page (within the application), it is lost ...
How to implement it in php?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
TROODON, 2012-06-16
@sergeyzhuzhgov

When authorizing, save the id in the session or set cookies from the session id, and save the session_id and vkontakte id in the database

A
Armanio, 2012-06-16
@Armanio

I add viewer_id and auth_key to each link: But my whole project works on Ajax - there are no full transitions, so I use this construction:
user.php?viewer_id=1&auth_key=178368163&action=profile

$.api=function(m,o,c){o.method=m;o.viewer_id=api.viewer_id;o.auth_key=api.auth_key;$.post('api.php',o,c);}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question