[thelist] Remember Me Option -Cookies

shawn allen shawn at alterior.net
Tue Feb 11 15:59:14 CST 2003


quoth Mark Joslyn:
> I am trying to add a "Remember Me" functionality to my login. I see
> these all over the place - even on Evolt.org.

AFAIK, all you've got to do is set an appropriate expiry on your cookie
(the default is 0, which really means "until the end of the UA
session").

<?php setcookie('foo', 'bar', time() + 365 * 24 * 60 * 60) ?>

...would set a cookie 'foo' to the value of 'bar', which would expire in
a year, regardless of whether the users closes their browser (well,
unless they delete the cookie manually). Really, though, check out the
php.net manual page -- there are some much better examples there. :)

--
shawn allen
  mailto://shawn@alterior.net
  phone://415.577.3961
  http://alterior.net
  aim://shawnpallen




More information about the thelist mailing list