Login   Register  
PHP Classes
elePHPant
Icontem

File: cookie

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2004-09-02 06:26
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) ;
    }
?>