Re: session problem
| From: | Chris Lee | Date: | Tue, 22 May 2001 23:12:52 +0000 |
| Subject: | Re: session problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-53951@lists.php.net to get a copy of this message | ||
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.
--
Chris Lee
lee@mediawaveonline.com
"Robert Schaller" <email@robertschaller.com> wrote in message
news:3B0AE63F.CE5FD491@robertschaller.com...
> Hi all,
>
> I'm having the following problem. I have PHP-4.0.5 staticaly compiled
> with apache 1.3.19, running on a red hat linux with a 2.2.12 Kernel.
>
> The following script does not work the second time called, the browser
> just "hangs" and returns a "this document is empty" after a while. I am
> getting no error message in the log files and the session files are
> being created in the tmp directory, they are empty though.
>
> <?
> session_name( "test" );
> session_start();
> $session_ok = session_register( "counter" );
> if( $session_ok ){
> echo( "Counter: ".++$counter );
> }else echo( "failed" );
> ?>
>
> Any ideas?
>
> How can I get some kind of hint as to what is going wrong?
>
> thanks,
> Robert
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>