RE: [PHP] Session problem
| From: | Chad Day | Date: | Wed, 08 Aug 2001 18:38:37 +0000 |
| Subject: | RE: [PHP] Session problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-61887@lists.php.net to get a copy of this message | ||
What it looks like it is doing to me, if you hit the script and reload it a
bunch, is it creates a session, sticks with it for a while, then dumps it ..
it then creates another session, starts over at 1, and begins counting up..
then sometimes it will see the old session, and go back to it ..
Like, this will happen:
You've seen this page 1 times (not gonna repeat the text)
2
3
4
5
1 // lost 1st session here
2
6 // regain 1st session
3 // switch
7
8
9
4 // switch
no matter how many times I reload that page, it seems to generate a max of 2
sessions. wtf is going on?
Chad
-----Original Message-----
From: Chad Day [mailto:cday@atpco.com]
Sent: Wednesday, August 08, 2001 2:36 PM
To: Johnson, Kirk; php-general@lists.php.net
Subject: RE: [PHP] Session problem
Still not working. My script is -exactly- as you have it below, and I
believe I've tried that before.
(begins pulling out hair)
Chad
-----Original Message-----
From: Johnson, Kirk [mailto:kjohnson@zootweb.com]
Sent: Wednesday, August 08, 2001 2:31 PM
To: php-general@lists.php.net
Subject: RE: [PHP] Session problem
> > > <?php
> > > session_start();
> > > global $count;
> > > session_register ("count");
> > > $count++;
> > > ?>
> > >
> > > Hello visitor, you have seen this page <?php echo
> > > $HTTP_SESSION_VARS["count"]; ?> times.<p>
There was a bug in PHP in versions prior to 4.0.6: $count and
$HTTP_SESSION_VARS["count"] did not reference the same value while on the
*current* page. Try this:
<?php
session_start();
$count++;
session_register ("count");
?>
Hello visitor, you have seen this page <?php echo $count; ?> times.
Kirk
--
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