// Session_start-start new or resume existing session
Session_start ();
Print_r ($ _ session );
// Check whether there is a session object. If there is a PHPSESSID in the request header, the key => No cookie for the value pair. If yes, you can use this ID to check whether the session object corresponding to the ID can be found.
// Normally, if the server receives PHPSESSID, the session exists.
The request header does not have a cookie with the PHPSESSID key => value, indicating that the server does not have a session object, create a session object (and write the key => value pair in the Set-cookei of the response header to notify the browser to save the session ID locally, you do not need to create a session object when you enter the page next time in the same session ,)
// You cannot manually delete the PHPSESSID saved by the session object in the browser. (If you can manually delete the session object, you want to create many $ _ Session ultra-global arrays on the server. The server certainly does not agree, you want to delete PHPSESSID before session_start (). For the same session, a new session object will be created next time,
Setcookie (PHPSESSID, "", time ()-100 );
Session_start ();
No, PHPSESSID can only be deleted by the server, so that the uniqueness of the $ _ session variable can be ensured in a process.