Package: Cookie


public class Cookie

Return to package list

Version: 1.0
Date: 2001-05-29 11:05:37

Author: John Luxford <> <>

Cookie is a class that is used to give auto-generated Cookie
variables their own distinct namespace, so as not to conflict with
other auto-generated variables, such as CGI data.  The Cookie class gets
its data from the $HTTP_COOKIE_VARS hash.

$cookie = new Cookie;

if (! empty ($cookie->session_id)) {
	// do something with the cookie
} else {
	// set the cookie
	$cookie->set ("session_id", "value", 1800, "/", "", 0);


public array $param

Contains a list of the names of all the cookie variables
available to the current script.


public Cookie () -> void

Constructor method.

public set (string $name, string $value, integer $expire, string $path, string $domain, boolean $secure) -> void

Sends a 'set-cookie' HTTP header to the browser.  Must be called
before any data has been sent.

$expire is the number of seconds from the current time.
$domain must contain at least two periods (.).
$secure accepts a 1 or a 0 to denote true or false.

Return to Top

This file was created by DocReader, an Open Source class documentation system.
Visit Simian Systems to learn more.