PHP permanent cookie

cookiesPHP

How do I set up a cookie that won't never expire, even when the user closes his browser or stops his machine?

Thanks!

Best Answer

I don't think there is a way to have a 'permanent' cookie, but rather one that expires very very far into the future. Just because you remained logged into a website/service the next time you return or after you close your browser, does not mean that there is no expiration date on the cookie.

Check out the PHP documentation on setting the lifetime of a cookie.