PHP sessions & MySQL
A Php Shopping - Cart WorkshopBASICHome [bp]
Functions to manage Sessions Data into a Site-DataBase - [ ONE FILE ] ®
$ssp = ... session_id () = b900b0b2c31ef72e834035e1ad1876d6 By opening this page a session starts and a record is generated into ics-php.com Database, as that is on the same server and access is granted to user bp... to verify that just surf view all records → CODE
Please select what you would like to buy :
↑
session_decode(); session_encode(); →
Comments :
By placing in a php file the following code : session_start(); , the web server will mark the related page with a unique string that is very much similar to a cookie.
What you read above in red color is just what is really happening to this page.
The string to the left of "=" [that's the server cookie name] is always "PHPSESSID" while to the right of "=" contains 32 alphanumeric chars and is closed by a semicolon, this second part is always different and is called "id", and its value is given also by the function "session_id()".
...so the following expression will print the id-string :
<?
print session_id();
/*
#...the following lines give the same results :
$id=session_id();
echo $id;
*/
?>
The link-related pages from here show the outputs of php code related to this property and show how to write data that relates to this unique string.
This unique string is issued on each new session of the client's browser.
These data can be saved into a database and be available for furher manipulations.