Today in a group of people asked to IE6 in the use of JS Open, found in a new window and get no session,
After using the following test code test found that because Phpsessionid storage is a process-level validity period, only the same process can be obtained, many people say, open or target= "_blank" will open the new IE process,
Therefore, the phpsessionid of the previous window does not follow the new window to go, resulting in the acquisition.
My own tests used IETEST,6/7/8 (9 does not start up, not sure), all appear the same situation.
However, this condition is not present in the IE10 test that is used with Windows.
Chrome is also multiple threads, but this is not the case.
Firefox does not exist in this situation.
index.php
Copy Code code as follows:
<?php
Setcookie (' kkkkk ', ' bbbb ', Time () + 1111111);
Session_Start ();
$_session[' qidizi '] = ' kkkk ';
Var_dump ($_session,$_cookie);
?>
<input type= "button" value= "D" onclick= "window.open ('./b.php ');"/>
<a href= "b.php" target= "_blank" >dddd</a>
b.php Jump Page
Copy Code code as follows:
<?php
Session_Start ();
Var_dump ($_session,$_cookie);
As you can see from the test, if the cookie setting is deferred, rather than process-level, it will be visible after the open
Therefore, in view of this situation, to prevent users from using the IE kernel login status is lost, can be used with cookies to use,
The PHP configuration provides a way to automatically add SIDs to the URI, but not automatically for relative paths.
Only, cookies are disabled in this extreme case, rarely encountered,
Cookie+session enough to handle the usual situation.