--- John Kaspar <[EMAIL PROTECTED]> wrote:
> My question is - how do I update the password cookie without having to 
> ask whether or not they want to remember it again? How can I find out 
> when the current cookie expires?

First, I hope you're not storing a password in a cookie, since it sounds like
you are.

To address your question, you can't. A Web client only returns a cookie name
and value in the Cookie header, so PHP does not have access to any other
information except that.

My advice is to examine how other sites do this sort of thing. For example, go
to Yahoo!, log into one of their services, and check the box that says remember
me. There will be a cookie with your username that expires sometime in the
future (one year maybe?). They keep up with everything else on the server.

Basically, cookie attributes are restrictive. You cannot make them less
restrictive with your server-side code, but you can make them more restrictive
with your server-side code. For example, if a cookie is set to expire in 24
hours, and someone goes to your site 48 hours later, that cookie won't be
there. If, however, the cookie is set to expire in 96 hours, and someone goes
to your site in 48 hours, you can decide whether you want to use the
information in the cookie or consider it to be expired.

Hope that helps.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to