PHP sessions & MySQL
A Php Shopping - Cart Workshop   BASIC   Home [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 :  



← To multiple Selection - press-hold Ctrl or Shift ...and click
The files into directory /cart/db can process inserted data into a tmp session file and save changes into a site Database , whilst the ones in the parent directory write data just into a tmp file.
Server tmp content is retrievable by using php functions as herein.
To put a product into cart click the multiple select text box and then click on the large form-button , an empty click on this button will delete the previous selected products.
All is set in this page will modify the record of the current session and can be univocally identified ( session_id () ) and re-utilized during the current browser session to place an order or for other purposes.
The Visitor can delete the order by empty-clicking. This is a Demo and the access is given for this to all our Visitors , but for servicing you would not let everybody to view all records   info
↑ 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.