Answer the question
In order to leave comments, you need to log in
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
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
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 questionAsk a Question
731 491 924 answers to any question