How to obtain the last session data of the browser:
Do you want to know what session_id is for the last session?
Do you want the PHPSESSID value stored in the cookie to be deleted as soon as the browser exits?
Therefore, we need to set our own session_id instead of Automatically Generated
Therefore, we need to set the cookie-saved key = "value's lifecycle modification to become longer
<? PHP
Session_id (110 );
// Change the life cycle of the session ID stored in the cookie to 10 minutes.
// The PHPSESSID stored in the cookie will not be deleted once the browser exits.
Session_set_cookie_params (60*10 );
Session_start ();
Echo "session_id =". session_id (). "<br/> ";
$ _ Session ['name'] = "wuxifu001, hello, how do you do !!!! ";
Echo "Hello <br/> ";
?>
Set the same as above when obtaining the data.
<? PHP
Session_id (110 );
// Change the life cycle of the session ID stored in the cookie to 10 minutes.
// The PHPSESSID stored in the cookie will not be deleted once the browser exits.
Session_set_cookie_params (60*10 );
Session_start ();
Print_r ($ _ session );
Echo "<br/> ";
Print_r ($ _ cookie );
?>