Ie and session loss (new window cookie loss) test and Solution

Source: Internet
Author: User
As stated in the title, the test result is: if the cookie settings are delayed and expire at the scheduled time, rather than at the process level, it can be seen after open. Therefore, in this case, prevents Loss of Logon status when using the ie kernel, and can be used with coo

As stated in the title, the test result is: if the cookie settings are delayed and expire at the scheduled time, rather than at the process level, it can be seen after open. Therefore, in this case, prevents Loss of Logon status when using the ie kernel, and can be used with coo

Today, someone in a group asked ie6 to use js open, and found that the session could not 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 to cope with common situations. Hong Kong servers, Hong Kong servers, and website Space

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.