From cd971dcd12a13a878b29c4edc66f08026a01e772 Mon Sep 17 00:00:00 2001 From: "Jesus M. Castagnetto" Date: Fri, 15 Sep 2000 00:27:05 +0000 Subject: [PATCH] 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 --- functions/http.xml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/functions/http.xml b/functions/http.xml index 415515034b..b378215e50 100644 --- a/functions/http.xml +++ b/functions/http.xml @@ -200,11 +200,14 @@ setcookie ("TestCookie", $value,time()+3600, "/~rasmus/", ".utoronto.ca", 1); <function>setcookie</function> delete examples 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); - + When deleting a cookie you should assure that the expiration date + is in the past, to trigger the removal mechanism in your browser. + Note that the value portion of the cookie will automatically be urlencoded when you send the cookie, and when it is received, it