Using PHP, how can I make a cookie expire after the browser is closed?
Using PHP, how can I make a cookie expire after the browser i开发者_如何学运维s closed?
Just don't set an expiry time. That will make it a session cookie.
This is mentioned in the documentation for the expire argument to setcookie:
If set to 0, or omitted, the cookie will expire at the end of the session (when the browser closes).
精彩评论