Changed cookie delete example to assure that the time referred is in the past

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@32714 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Jesus M. Castagnetto 2000-09-15 00:27:05 +00:00
parent 29e018c78c
commit cd971dcd12

View file

@ -200,11 +200,14 @@ setcookie ("TestCookie", $value,time()+3600, "/~rasmus/", ".utoronto.ca", 1);
<title><function>setcookie</function> delete examples</title>
<programlisting role="php">
setcookie ("TestCookie");
setcookie ("TestCookie", "", time());
setcookie ("TestCookie", "", time(), "/~rasmus/", ".utoronto.ca", 1);
// set the expiration date to one minute ago
setcookie ("TestCookie", "", time() - 3600);
setcookie ("TestCookie", "", time() - 3600, "/~rasmus/", ".utoronto.ca", 1);
</programlisting>
</example>
</para>
When deleting a cookie you should assure that the expiration date
is in the past, to trigger the removal mechanism in your browser.
</para>
<para>
Note that the value portion of the cookie will automatically be
urlencoded when you send the cookie, and when it is received, it