PHP Classes

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: 19 years ago
Size: 319 bytes


Class file image Download
// 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) ;