How to deal with Session lost value after PHP Jump
This article will explain in detail how to deal with the lost value of Session after PHP jump, and the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
.... Key = get_qq_token ($_ GET ["code"], $_ GET ["state"], $_ SESSION ["URI"]); if ($key ['access_token']! = = false) {$_ SESSION [' qq_keys'] = $key; $me = get_qq_user_info ($key ['access_token'], $key [' openid']);}.
I found the method called after setting session to fetch user information, which uses the curl function class of php to make a request to the specified url. Then I began to wonder "whether the value of session has been disposed of here, and I don't know if the curl_close method will empty the current session value." as mentioned earlier, I don't know why, but this doubt did help me solve the problem, so I postponed the session setting until after the calling method, that is,
$me = get_qq_user_info ($key ['access_token'], $key [' openid']); $_ SESSION ['qq_keys'] = $key
As a result, the problem is really solved, and the session is passed to the jump page normally. I don't know why, but you might want to remember a trick: session is set after the curl request, and interspersing the curl request will cause the session to be lost.
How to deal with the lost value of Session after PHP jump is shared here. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.