session vars not being read?
| From: | Static | Date: | Tue, 05 Dec 2000 18:23:25 +0000 |
| Subject: | session vars not being read? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-28736@lists.php.net to get a copy of this message | ||
Hi all, I have a site that allows people to log in and then customizes
an online lesson for them based on their info in a mySQL database. I am
using session variables so that I can use these variables in different
scripts on the site. I have come across one user who simply does not
seem to be able to work with the session variables, i.e. anything I pull
from the db and put into session vars doesn't show up when he clicks on
a link to a script on the site. Does anyone know why this might happen?
Here is an example of what I mean:
On the main page, I do the following at the top:
<?php
session_start();
if (!$PHPSESSID) {
session_register('videoid');
} else if (!$videoid){
session_register('videoid');
?>
Then I get a value from the db and put it into $videoid. When the user
is on the main page and clicks on a link to another script, at the top
of the script I have:
<?php
session_start();
?>
And then I try to use $videoid in that script. I have never had a
problem until now... this one user gets no value in $videoid! So if I
want to say "Hi user, your video id is 3" where $videoid=3, he actually
sees "Hi user, your video id is ".
Can someone please help, I'm going insane trying to figure out why this
would happen to this one person?
Thanks VERY much in advance,
Omar