PHP Classes

File: cookie_delete.php

Recommend this page to a friend!
  Classes of Brian Moon  >  SiteCookie  >  cookie_delete.php  >  Download  
File: cookie_delete.php
Role: Example script
Content type: text/plain
Description: Show how to destroy the cookie
Class: SiteCookie
Author: By
Last change:
Date: 18 years ago
Size: 414 bytes
 

Contents

Class file image Download
<?php

   
// You can destroy the entire cookie two ways.
    // 1. set the expire time in the past
    // 2. call the clear() method and then the set() method.

    // Include the Class
   
include "SiteCookie.php";
   
   
// Create a local object
   
$SiteCookie=new SiteCookie("test_cookie", time()-86400);
   
   
// Clear all values
   
$SiteCookie->clear();

   
// Set the cookie
   
$SiteCookie->set();
   
?>

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