Location: PHPKode > scripts > CGI.php > cgi-php/Cookie_Docs.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
	<title>DocReader Online Converter</title>

	<link rel="stylesheet" type="text/css" href="/css/site.css" />
</head>
<body>

<a name="top"></a>

<h1>Package: Cookie</h1>

<p style="margin-bottom: 10px; padding-bottom: 5px"><a href="#Cookie">Cookie</a><br />
</p>



<a name="Cookie"></a><table width="98%" cellpadding="3" border="0" cellspacing="0">
									<tr>
										<td width="70%" class="head">
											<h1>public class Cookie </h1>
										</td>
										<td width="30%" class="head" align="right">
											<a href="/index/docreader_view" class="textured">Return to package list</a>
										</td>
									</tr>
								</table>

<p><strong>Version: 1.0 <br />
Date: 2001-05-29 11:05:37</strong></p>



	<p><strong>Author: John Luxford &lt;<a href="mailto: hide@address.com">hide@address.com</a>&gt; &lt;<a href="http://www.simian.ca/">http://www.simian.ca/</a>&gt;</strong></p>



	<pre style="margin-bottom: 10px; padding-bottom: 5px"><strong>Summary</strong>
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.

</pre>



	<pre style="margin-bottom: 10px; padding-bottom: 5px"><strong>Example</strong>
$cookie = new Cookie;

if (! empty ($cookie-&gt;session_id)) {
	// do something with the cookie
} else {
	// set the cookie
	$cookie-&gt;set (&quot;session_id&quot;, &quot;value&quot;, 1800, &quot;/&quot;, &quot;.site.com&quot;, 0);
}

</pre>

  <table width="98%" cellpadding="3" border="0" cellspacing="0"><tr><td width="100%" class="head"><h1>Properties</h1></td></tr></table>

<h2 style="font-weight: normal">public array <strong>$param</strong></h2>


<pre style="margin-bottom: 10px; padding-bottom: 5px"><strong>Summary</strong>
Contains a list of the names of all the cookie variables
available to the current script.

</pre>



  <table width="98%" cellpadding="3" border="0" cellspacing="0"><tr><td width="100%" class="head"><h1>Methods</h1></td></tr></table>

<h2 style="font-weight: normal">public <strong>Cookie</strong> () -> void</h2>


<pre style="margin-bottom: 10px; padding-bottom: 5px"><strong>Summary</strong>
Constructor method.

</pre>



  <h2 style="font-weight: normal">public <strong>set</strong> (string <strong>$name</strong>, string <strong>$value</strong>, integer <strong>$expire</strong>, string <strong>$path</strong>, string <strong>$domain</strong>, boolean <strong>$secure</strong>) -> void</h2>


<pre style="margin-bottom: 10px; padding-bottom: 5px"><strong>Summary</strong>
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.

</pre>









  



<p align="right"><a href="#top">Return to Top</a></p>

<hr size="1" noshade="noshade" />

<p align="center">This file was created by <a href="http://www.simian.ca/index/docreader">DocReader</a>, an <a href="http://www.simian.ca/index/open_license">Open Source</a> class documentation system.<br />
Visit <a href="http://www.simian.ca/">Simian Systems</a> to learn more.</p>

</body>
</html>
Return current item: CGI.php