File: cookie

Recommend this page to a friend!
  Classes of kostas gougakis  >  Shopping basket with MySQL connection  >  cookie  >  Download  
File: cookie
Role: Auxiliary script
Content type: text/plain
Description: cookie
Class: Shopping basket with MySQL connection
Shopping basket stored in a MySQL database
Author: By
Last change:
Date: 15 years ago
Size: 319 bytes
 

Contents

Class file image Download
<?PHP
// Generation of SESSION ID (cookie based)
// Cookie will last for 3 hours, enough for any simple purchase
// This is just an example of how it can be done

 
if (!$sessionID)
    {
   
$sessionID = uniqid("") ;
   
$expires = time() + 3*3600 ;
   
setcookie("sessionID",$sessionID,$expires) ;
    }
?>


For more information send a message to info at phpclasses dot org.