Session_unset ()
Releases all the $ _ SESSION variables that have been created in the memory, but does not delete the session file or release the corresponding sessionid.
Session_destroy ()
Delete the session file corresponding to the current user and release the sessionid. The $ _ SESSION variable in the memory is retained.
Therefore, to release all resources of a user's session, execute the following code in sequence:
Program code
Copy codeThe Code is as follows:
<? Php
$ _ SESSION ['user'] = 'hangzhou ';
Session_unset ();
Session_destroy ();
?>
If you only call session_destroy ();
The echo $ _ SESSION ['user'] still has a value.
That is, the $ _ SESSION variable content in the memory is retained.
[Session]
Session. save_handler = files; Control Method for saving/retrieving data
Session. save_path = C: \ win \ temp; parameters passed to the controller when save_handler is set to a file,
; This is the path where the data file will be saved. Folder must be created in advance
Session. use_cookies = 1; whether to use cookies 1 Yes, 0 No
Session. name = PHPSESSID
The name of the session used in the cookie.
Session. auto_start = 0; initialize the session when the request starts.
Session. cookie_lifetime = 0; the time when the cookie is saved in seconds,
; Or 0 until the browser is restarted
Session. cookie_path =/; valid cookie Path
Session. cookie_domain =; valid domain of the cookie
Session. serialize_handler = php; controller used to connect data
Php is the standard controller of PHP.
Session. gc_probability = 1; percentage of 'garbage collection (fragment) 'Processes
; The possibility of starting each session initialization.
Session. gc_maxlifetime = 1440; after the number of seconds, the stored data will be treated
; 'Garbage 'and cleared by the gc process.
Session. referer_check =; check the HTTP reference to invalidate the ids contained in the URL.
Session. entropy_length = 0; the number of bytes read from the file
Session. entropy_file =; specify the session id created here
; Session. entropy_length = 16
; Session. entropy_file =/dev/urandom
Session. cache_limiter = nocache; set to {nocache, private, public} to determine the HTTP
; Cache Problems
Session. cache_expire = 180; document expired after n minutes
Session. use_trans_sid = 1; Use the transitional sid support.
; -- Enable-trans-sid
Url_rewriter.tags = "a = href, area = href, frame = src, input = src, form = fakeentry"