Session variables
| From: | Paul M Foster | Date: | Sat, 07 Feb 2009 06:58:46 +0000 |
| Subject: | Session variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-287885@lists.php.net to get a copy of this message | ||
I'm not too clear on HTTP headers, cookies, and such. So here are
questions related to that. Let's say I generate a random number that I
want the user to enter in a form. When I generate the number, I store it
in a session variable ($_SESSION). When the user submits the form, I
check the number they enter with what I've stored in the session
variable.
Since this session variable survives across page loads (assuming
session_start() is appropriately called), how is it stored and recalled?
Is it automatically stored as a cookie on the user's system?
Or is it stored on the server?
And how does a server "get" a cookie?
Is it a separate request made by the server to the client?
If the value I've asked the user for is *not* stored as a cookie, then
is it passed as part of the HTTP submission or what?
Thanks for any enlightenment on this.
Paul
--
Paul M. Foster