1. session can save any type of data. Because it is stored on the server (I .e. serialized ).
2. session Operation Mechanism
Session_start (); // The session has been enabled, which is equivalent to reading the session information.
$ _ SESSION ['favcolor'] = 'green ';
$ _ SESSION ['animal '] = 'cat ';
$ _ SESSION ['time'] = time ();
// Works if session cookie was accepted
Echo '<br/> <a href = "page2.php"> page 2 </a> ';
Page2.php
Echo $ _ SESSION ['favcolor']; // green
Echo $ _ SESSION ['animal ']; // cat
Echo date ('y m d H: I: s', $ _ SESSION ['time']);
Session_start declares the $ _ SESSION variable, assigns a value to $ _ SESSION, and writes data in $ _ SESSION to the data space and releases the variable.
Deleting $ _ SESSION cannot be unset. You can leave it blank: $ _ SESSION = array ();
Delete the current $ _ SESSION data file session_destory () in the default system path C: windos/Temp. You can find this directory in the browser.
Delete sessionID in the browser using cookie technology
SetCookie ('phpsessid ', time ()-1 );
Three sessions can be completely deleted.
3. The cycle may be inconsistent.