Is it possible to set a cookie which doesn't expire? I want to include a "remember my password" function on one of my scripts, but I know not including an expiration date means teh cookie expires when the browser is closed. Any help would be appreciated!
Thanks! Marc
i think they have to expire sometimes.. but you can push them as far in the future as you want:
<?php setcookie("TestCookie", $email, time() + 36002460); // Expire in 60 days ?>
Thanks. That's what I was afraid of. Guess I'll set it for six months or a year, and hope they remember their passwords after the cookie expires 😃
Everytime the user logs in, just keep setting the cookie (using the aforementioned function call). That way, if the user logs in within the next six months, it will set the cookie for a "new" six months into the future.