RE: [PHP] Session Variables
| From: | Johnson, Kirk | Date: | Thu, 03 May 2001 20:32:31 +0000 |
| Subject: | RE: [PHP] Session Variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-51326@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Nikhil Goyal [mailto:ngoyal@nypirg.org]
> When does a session variable become available? Immediately after the
> session_register command or after the script ends?
Immediately after it is assigned.
> And if the commands are as follows:
>
> session_start();
> session_register("hello");
> $hello=3;
>
> will the session variable $hello be set to 3 or do I have to
> add another
> session_register() call after changing the value?
No additional calls are needed. You will need to do session_start() on the
next page if you want to access $hello there.
Kirk