Why is the session not available after URL redirection?
http://www.baidu.com/index.php write a session[' key ' at this time = 200;
Redirect to http://www.sian.com, http://www.sian.com redirect to
http://www.baidu.com/index.php, found session[' key ' will not be found??
Excuse me, why? Is there a cookie in this situation?
Reply content:
Why is the session not available after URL redirection?
http://www.baidu.com/index.php write a session[' key ' at this time = 200;
Redirect to http://www.sian.com, http://www.sian.com redirect to
http://www.baidu.com/index.php, found session[' key ' will not be found??
Excuse me, why? Is there a cookie in this situation?
Are you using server-side direct redirect? If so, there is a good chance that this problem will arise. Because the session should correspond to the cookie
client-->A(set session and redirect to B)-->B-->A
The first time you access a set cookie may not be saved to the user's browser, you receive a 302 redirect away, so return to a when there is no cookie to the corresponding session, of course, it may be redirected from B to a, because cross-domain, the request head does not have a domain cookie, So I can't get to the session.
So this redirect, is generally done separately to do a redirect page (JS or other way) do jump, rather than direct server-side redirect, reference microblogging, space and other sites have similar special redirect page
The program or the viewer? The browser's words are related to the settings of the service and the settings of the viewer.
The session can be preset at each redirect, which guarantees that the session will remain valid after each redirect.