Login   Register  
PHP Classes
elePHPant
Icontem

File: cookie.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Carlos Falo Hervás  >  basic_basket  >  cookie.php  >  Download  
File: cookie.php
Role: Application script
Content type: text/plain
Description: Example code to generate the sessionID cookie
Class: basic_basket
Basic Shopping basket system
Author: By
Last change:
Date: 2001-02-07 06:59
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) ;
    }
?>