Re: session problem

From: Date: Wed, 23 May 2001 10:12:47 +0000
Subject: Re: session problem
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-54013@lists.php.net to get a copy of this message
Hi Chris, thanks for your fast reply. I tried your advice, checking if a variable is already registered before registering it again, the problem remains. The thing that bugs me is that I am getting no error message whatsoever, session_register is returning true and there is nothing in the log file. I ran tcpdump to see what is going on, this is what happens: 1. on the first call I'm getting a OK HTTP reply with a set cookie and the session file is being created in the session file path, its empty though (the file is web server readable, writable). A "Counter: 1" is returned. 2. The second call delivers the cookie correctly to the script, the script doesn't set a new cookie this time, returns a HTTP OK, replies with "Counter: 1", obviously the session variable $counter was not kept. 3. On the third call, I am getting no HTTP reply from the Server. If I close the browser and open it again, the same thing 1-3 happens again. Same with NS and IE! Something is broken here! regards, Robert Chris Lee wrote: > > calling session_register() on a var that is allready registered is asking > for trouble. there seems to be some bug in php concerning this. > > <?php > > session_start(); > > if (!isset($HTTP_SESSION_VARS['counter'])) > { > $counter = 0; > session_register('counter'); > } > $counter++; > > echo " > Counter: $counter<br> > "; > > ?> > > will work better for you I hope. please get back to me regarding how this > worked out.

« previous php.general (#54013) next »