RE: [PHP] $_SESSION
| From: | Aaron Wolski | Date: | Tue, 20 Jan 2004 18:30:47 +0000 |
| Subject: | RE: [PHP] $_SESSION | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-175172@lists.php.net to get a copy of this message | ||
You need to call session_start() on each page.
> -----Original Message-----
> From: Alex Hogan [mailto:Alex.Hogan@AlliedElec.com]
> Sent: January 20, 2004 1:29 PM
> To: PHP General list
> Subject: [PHP] $_SESSION
>
> I've got a question that I'm sure has a simple answer.
>
>
>
> Why aren't my session objects transferring across more than one page?
>
>
>
> I'm calling a session object that was set in the page prior;
>
> $_SESSION['mysessionvar'] = $_REQUEST['mytxtobj'];
>
>
>
> I then assign a variable that value;
>
> $myvar = $_SESSION['mysessionvar'];
>
>
>
> echo $myvar;
>
>
>
> This displays like I expected. However when I go to the next page and
> want
> to display this var again I get either an Undefined index or variable.
> According to the docs $_SESSION[] is now global and this is the way of
> setting and retrieving session objects, right?
>
>
>
> I have tried calling that session object again but it's empty and so
is
> the
> variable. I thought that the session would stay open until I close
the
> browser and I could return those values any time I wanted. Am I
missing
> something?
>
>
>
>
>
>
>
> alex hogan
>
>
>
>
>
> ******************************************************************
> The contents of this e-mail and any files transmitted with it are
> confidential and intended solely for the use of the individual or
> entity to whom it is addressed. The views stated herein do not
> necessarily represent the view of the company. If you are not the
> intended recipient of this e-mail you may not copy, forward,
> disclose, or otherwise use it or any part of it in any form
> whatsoever. If you have received this e-mail in error please
> e-mail the sender.
> ******************************************************************
>