sometimes you might have problems even if using both session_unset and session_destroy. You have to clear the $_SESSION array. I got it working this way:
session_unset();
session_destroy();
$_SESSION = array();
![]() | session_unsetDescriptionvoid session_unset ( void )The session_unset() function frees all session variables currently registered.
![]()
InterNic
20-May-2006 06:20
sometimes you might have problems even if using both session_unset and session_destroy. You have to clear the $_SESSION array. I got it working this way:
07-Mar-2006 11:56
Yes, that's how it is, first you write session_unset, and then the sentence session_distroy
zach at zkwarta dot com
14-Jul-2005 06:32
The difference between both session_unset and session_destroy is as follows:
Jeroen
15-Jan-2005 05:42
note to Jason: I don't know the exact mechanics of it (since I'm quite new to sessions) but I think you need to use session_unset() BEFORE you can use session_destroy() at all. I thought that session_unset() was for scripted variables, and session_destroy() just for anything saved on your side regarding the session.
22-Mar-2001 12:58
To further clarify the note above... this can be done via the session handling directives in your php.ini file... there are options to set garbage collection probability (via percent... i.e. 75 means it would run 3 out of every 4 page accesses), and the amount of time a session object can remain active before the garbage collection process sees it as garbage.
dmertens at zyprexia dot com
01-Feb-2001 01:11
The session files are automaticly deleted after the session-timeout is reached. So if the time-out is set to 20 minutes, the files will be deleted 20 minutes after the last access. Same for the cookie. Every time, an page is requested, the cookie-ttl is set to now + 20 minutes.
diogo dot afonso at terravista dot pt
30-Aug-2000 01:09
The only thing needed to really destroy the session is :
j a s o n p 0 1 9 at yahoo dot com
14-Jul-2000 04:26
session_unset() vs. session_destroy():
| ![]() | ||