NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
PHP sessions


Joined: 13 Jun 2006
Posts: 2
Reply with quote
I have another problem with session. I have stoped debugging and all sessions's variables are stored. When i start debug again, this variables are not empty. How can i delete them? (When i restart phpEd - all variables are empty) Sorry for my english Smile
View user's profileFind all posts by cfifSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
you may want to read http://www.php.net/session on how php handles sessions.
Neither PhpED nor DBG debugger are involved.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 13 Jun 2006
Posts: 2
Reply with quote
Thanks, i have solved my problem Smile
View user's profileFind all posts by cfifSend private message
Veteran

Joined: 22 Sep 2005
Posts: 113
Reply with quote
cfif wrote:
Thanks, i have solved my problem Smile

How have you solved it? I'm interested because I have to use an script only to clean session variables in order to not have to shut down phpED. The script is just
Code:
<?php
session_start();
$_SESSION = array();
session_destroy();
session_write_close();
?>

Theorethically, if I close the phpED Output window, the session cookie should be dropped and the session should be terminated. But things doesn't happen this way.
View user's profileFind all posts by HoTShoTSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
Theorethically, if I close the phpED Output window, the session cookie should be dropped

Even in theory, they shoud not be dropped Smile
Cookie belong to application (a running process in terms of Win32) and you should either change cookie value or finish the process to have them dropped.
There are two ways, actually:
a) do not use embedded browser (use external either FF or IE or maybe Opera)
b) replace cookie value with empty string or pre-defined bogus value. (Run->Parameters, cookie)
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Veteran

Joined: 22 Sep 2005
Posts: 113
Reply with quote
ddmitrie wrote:
Even in theory, they shoud not be dropped Smile

You're correct. That's why all the multi-tabbed browsers make a mess with session variables when you open 2 or more tabs from the same server. All the tabs share the session cookie.

The easiest way I found was to use the small script to clean session variables. A feature request for phpED would be to add a button to "Clear Session Variables" in the toolbar or the ability to link a button there to a php script. Smile
View user's profileFind all posts by HoTShoTSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Feature request?
I think you're all set Smile
In 4.6 you can add your script to Launchbox and run it from there everytime you need.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
PHP sessions
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