PHP session tracking End and file processing system one (43),
Unregister variables
1, unset ($_session[' xxx ']) Delete a single session variable, unset ($_session[' xxx ") is used to unregister a registered session variable. Its effect is the same as Session_unregister (). Session_unregister () is no longer used in PHP5.
Note: unset ($_session) This function must not be used, it will destroy the global variable $_session, and there is no viable way to restore it. Users can no longer register $_session variables.
2. $_session=array () delete multiple SESSION variables
3, Session_unset () Delete all session variables
Destroying sessions
Session_destroy () ends the current session and empties all resources in the session. The function does not unset (releases) the global variables associated with the current session, nor does it delete the client's session cookie.
Return value: A Boolean value.
Function Description: This function ends the current session, this function
There are no parameters, and the return value is true.
Note: PHP's default session is cookie-based, and if you want to delete cookies, you must use the Setcookie () function.
Delete a session case
? PHP // initializes the session. session_start (); /* Delete all the session variables: unset ($_session[' xxx ') can also be deleted individually. */= Array (); // or Session_unset (); /* Delete Sessinid. Because the session is cookie-based by default, use Setcookie to delete the cookie that contains the session ID. */ if ", Time ()-42000,'/' );} // Finally, the session is completely destroyed. Session_destroy ();? >
Persistent session
All registered variables are automatically serialized at the end of the request (for easy saving to the server-side session text file) and then restored when read.
http://www.bkjia.com/PHPjc/1012252.html www.bkjia.com true http://www.bkjia.com/PHPjc/1012252.html techarticle PHP Session trace with file processing System One (43), unregister variable 1, unset ($_session[xxx]) Delete a single session variable, unset ($_session[xxx]) is used to unregister a registered SES ...