Re: Php 4 Deleteing Cookies: Trying to set and delete a cookie in same page

From: Date: Fri, 07 Jun 2002 00:28:47 +0000
Subject: Re: Php 4 Deleteing Cookies: Trying to set and delete a cookie in same page
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-101045@lists.php.net to get a copy of this message
first, it's not PHP that won't delete the cookie...it's the nature of cookies. second, there is no need to try to delete it and set it to a new value. Just set it to the new value. third, the cookie will expire and disappear when the browser closes. The browser MUST close, not simply go to another page. ---- Original Message ----- From: "John Weez" <john@atomfx.com> To: <php-general@lists.php.net> Sent: Thursday, June 06, 2002 6:55 PM Subject: [PHP] Php 4 Deleteing Cookies: Trying to set and delete a cookie in same page Hi all. I'm trying to delte a cookie and then set it to a new value in a php page. The problem is that once the cookie is set. PHP will not delete it. I use PhP 4. Here is the code...The pgp file name is testcookie.php...so the page goes back to itself again..i'm testing to see my code was allowing me to update the cookie to new values...etc...any ideas??? <?php setcookie("username",""); setcookie("username",$username); ?> <HTML> <BODY> <FORM NAME="FORM" ACTION="./testcookie.php"> Your name:<INPUT TYPE="TEXT" NAME="username"> <INPUT TYPE="submit" NAME="submit" value="submit" </FORM> </BODY> </HTML> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#101045) next »