Ie and session loss (new window cookie loss) Test and solution. Today, someone in a group asked ie6 to use js open and found that the session could not be obtained in the new window. after using the test code below, we found that, this is because phpsessionid is stored at the process level. someone in a group today asked ie6 to use js open, and found that the session cannot be obtained in the new window,
The test code below shows that the phpsessionid storage is a process-level validity period and can only be obtained by the same process. many people say that after opening, or target = "_ blank ", will open a new ie process,
Therefore, the phpsessionid of the previous window is not followed by the new window, so that the new window cannot be obtained.
In my own test, ietest, 6/7/8 (9 cannot be started, not certain), all of which share the same situation.
However, the windows ie10 test does not exist.
Chrome is also multi-threaded, but this does not happen.
Firefox does not exist.
Index. php
The code is as follows:
Setcookie ('kkkkk ', 'bbbbbb', time () + 1111111 );
Session_start ();
$ _ SESSION ['qidizi'] = 'kkkkk ';
Var_dump ($ _ SESSION, $ _ COOKIE );
?>
Dddd
B. php jumps out of the page
The code is as follows:
Session_start ();
Var_dump ($ _ SESSION, $ _ COOKIE );
From the test, we can see that if the cookie settings are delayed and expire at the scheduled time, rather than at the process level, it can also be seen after the open,
Therefore, to prevent loss of the logon status when using the ie kernel, you can use it with cookies,
Php configuration provides a method to automatically add sid to uri, but it does not automatically add relative paths,
However, cookie is disabled in rare cases,
Cookie + session is sufficient for common cases.
Pipeline, after testing with the following test code, we found that the phpsessionid is stored at the process level...