NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
How do I clear $_SESSION when my debug session ends?


Joined: 17 Oct 2005
Posts: 10
Reply with quote
I've looked everywhere.

I'm currently running PhpEd 4 on XP, in SRV local web server mode.

The problem I have is that I set a few session variables. When I stop the debugger,
and then restart (from index.php), I want the $_SESSION to start fresh again (empty).

I can't use index.php to clear $_SESSION variables because index.php calls itself, and
I need to keep the variables for the duration of the debugging session.

Please advise, Thx,
Chris
View user's profileFind all posts by chriscoSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Php keeps tracking sessions using either cookie or a dedicated session variable passed via GET.
In first case, just close [Output] window with browser and it will drop all non-persistent cookies.
In case of GET variables you have to either remove it or change its value to any bogus one.

Regarding sessions themselves, they are stored either in files (in most cases) or in database. In rare cases they are stored in shared memory. Check your session-related php settings. In case of files, the easiest way to drop all sessions is to remove these files Smile
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 17 Oct 2005
Posts: 10
Reply with quote
Thank you for your quick and clear response!

Closing the output tab didn't seem to have an effect, but looking at php.ini and finding and killing the session files worked perfectly.


Chris
View user's profileFind all posts by chriscoSend private message
How do I clear $_SESSION when my debug session ends?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic