RE: [PHP] SESSION VARIABLES
| From: | Adam Bregenzer | Date: | Tue, 10 Feb 2004 09:32:04 +0000 |
| Subject: | RE: [PHP] SESSION VARIABLES | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-177261@lists.php.net to get a copy of this message | ||
On Tue, 2004-02-10 at 03:13, Ronald Ramos wrote:
> It Worked. Thanks Man!
> So I can use this to any other page?
Awesome! You have access to the $_SESSION variables on any php page on
the same server. Just make sure you call session_start() before you
access the $_SESSION array.
> Let's say I have two users, first one logged in, using ronald as
> username, while user ronald is still logged-in
> User nhadie also logged-in from somewhere, will the value of $username
> of user ronald be changed to nhadie?
No, with sessions there will essentially be multiple values for the
variables, one for each session. When a user requests a page their
session id will be used to set the correct values in the $_SESSION
array. For example, when ronald loads the page $_SESSION['username']
will be ronald. When nhadie loads the page the $_SESSION['username']
variable will be nahdie.
--
Adam Bregenzer
adam@bregenzer.net
http://adam.bregenzer.net/