Session Life and cross-domain cross-page---Small Doubts big puzzle (PHP)

Source: Internet
Author: User

Session disappears after cross-page?

Session storage points to note:

    1. stored as a file on the server side.
    2. The lifecycle is limited and is determined by the different server types.
    3. Store content as serialized string

The contents of the session file are stored in the following format:

  

  From the picture we can read some session information: for example

  There is a session for error, its value is null, and there is a session: step, its value is 0, and so on.

Now that we know the mechanism of the session, we have to meet a few conditions to make the session accessible across pages:

1. Turn on Session.use_trans_sid, which is found in PHP config file php.ini session.use_trans_sid
Then change the value to 1 and remove the comment,

2. Since it is stored as a file, make sure that the directory where the session file is saved is present and writable and can be phpinfo ()
View the session information. The directory Session.save_path to save the session file.

Finally restart the php-fmt.

* Finally attach the session information:

Session Life and cross-domain cross-page---Small Doubts big puzzle (PHP)

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.