Session disappears after cross-page?
Session storage points to note:
- stored as a file on the server side.
- The lifecycle is limited and is determined by the different server types.
- 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)