A
A
Alexey Ivanov2016-02-26 17:25:48
PHP
Alexey Ivanov, 2016-02-26 17:25:48

How to make sure that the data remains when the page is refreshed?

I have authorization on the site through VK. after authorization, the user data is displayed, but nothing is displayed when the page is refreshed, since the url vklogin.php?code=35dc63cc6e9731f116 is not replaced. if you go back to the login link, then everything is displayed normally, since the code becomes different. how to make the link not have this code, but just a link and when the page is refreshed, the data remains?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrzej Wielski, 2016-02-26
@wielski

Save user info to session? Register it by adding it to the database? Save his token somewhere else, write data to the session, and pull the necessary information on the page using the token?
Sea options.

A
Archakov Dennis, 2016-02-26
@archakov06

cookie

I
IIISpikerIII, 2016-02-26
@IIISpikerIII

Every time you try to go through authorization again, it is enough to save it to the session the first time you receive the token, and substitute the token for further requests to Api, but it is also worth considering that the token may expire and you will need to request a new one

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question