Re: cannot remove cookies
| From: | Jason Barnett | Date: | Tue, 22 Feb 2005 14:34:44 +0000 |
| Subject: | Re: cannot remove cookies | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-209178@lists.php.net to get a copy of this message | ||
Bruno Santos wrote:
> Hello.
>
> I'm using 2 cookies to control some user environmente.
> every time the user logs in, the cookie is set, but when i try to change
> the value of that cookie,
> deleting it firts and then setting a new one with another value, when i
> print the value of that cookie
> the value is never the new one, but always the firts.
>
> im setting the cookie with:
> setcookie ("cookie_name",cookie_value,time()+time-to-expiration);
>
> when deleting it, i do
> setcookie ("cookie_name");
> or
> setcookie ("cookie_name","",time()-time-to-expiration);
time-to-expiration may as well be something fixed and fairly large...
this way you account for a computer's clock being off from the actual
time. 3600 is good. I'm guessing that this is the cause of your problem...
>
> but it never works
If this is a session cookie that you are trying to destroy then you
should go ahead and destroy both the session as well as the cookie.
>
> the browser im testing it is firefox (linux)
> but in IE is not working either...
>
> PHP version is PHP-5.0.3
>
> Apache version is Apache-2.0.52
>
> Cheers
>
> Bruno Santos
>
--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc