note 24074 added to function.session-register

From: Date: Tue, 06 Aug 2002 00:29:47 +0000
Subject: note 24074 added to function.session-register
Groups: php.notes 
Request: Send a blank email to php-notes+get-34362@lists.php.net to get a copy of this message
I had trouble getting sessions working. The symptom was that the session variables could be set once, but they never changed. For example, in the following code, "counter" would always display as 1. <?php session_start(); // register a session variable session_register('counter'); // increment and display the value of the counter $counter++; echo("You have visited this page $counter times! Don't you have anything else to do, you bum?!"); ?> I could see the session file created, and I could see it being updated... but the value of counter in the file never changed. The problem turned out to be that the expected path of php.ini was NOT the path where php.ini was. PHP never complained about this, and did everything else right... so the solution was not obvious. To see if this is the case for you, run this code: <?php phpinfo(); ?> and check the field that lists the php.ini path. -- http://www.php.net/manual/en/function.session-register.php http://master.php.net/manage/user-notes.php?action=edit+24074 http://master.php.net/manage/user-notes.php?action=delete+24074 http://master.php.net/manage/user-notes.php?action=reject+24074

« previous php.notes (#34362) next »