开发者

Using PHP, how can I make a cookie expire after the browser is closed?

开发者 https://www.devze.com 2023-04-09 03:21 出处:网络
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.

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).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号