I want to know how server stores(not location but procedure/methodology) and manages session variables.Please correct if I am wrong.
I visualise it as:-
Suppose if i create three session variables
$_SESSION['id']=12;
$_SESSION['flag']=t;
$_SESSION['name']=alex;
then the server creates a table (or a file whatever)
-----------------------------------------------
session_id | id | flag | name
-----------------------------------------------
a45sdg665 | 12 | t | alex
| | |
| | |
the session_id is created by server which is unique for each user.The server then sends the session_id to the client browser as a cookie .When the user sends another request during his session then that session_id is also sent by the browser along with the request. The server then refers the table and can identify the user. We ,as a programmer, can use id(stored by us) to fetch different information from the database. (If I am wrong ,please explain the procedure briefly).