> -----Original Message-----
> From: Mikusch, Rita [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 22, 2002 12:30 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] sessions -- behind the scenes??
> 
> 
> This may be a silly question . . . where is the information 
> that sessions
> hold actually kept? Are cookies generated? Do sessions just 
> simplify the
> process of generating those cookies and keeping track of that 
> information?

By default, session data is stored in a file in /tmp, but you can specify
another place, like a database. PHP generates a session id, which is part of
the filename of the session file. PHP passes a cookie containing the session
id to the browser, so that PHP can keep track of which session file belongs
to which browser request.

Below is an example script along with its associated session file.

Kirk

<?
session_start();
$a = "MickeyMantle";
$b = 7;
$c = 3.14159;
$d = array(7,8,9);
$e = array('spot' => 'dog',
           'fluffy' => 'kitty',
           'mighty' => 'mouse');
$f = 0;
$g = '0'; 
session_register('a','b','c','d','e','f','g','h'); 
?>

session_file:/tmp/sess_37c7968b6da03aadb9e5449428a67a2d
-------------
a|s:12:"MickeyMantle";b|i:7;c|d:3.14159;d|a:3:{i:0;i:7;i:1;i:8;i:2;i:9;}e|a:
3:{s 
:4:"spot";s:3:"dog";s:6:"fluffy";s:5:"kitty";s:6:"mighty";s:5:"mouse";}f|i:0
;g|s 
:1:"0";!h|

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to