Shakti Singh Shakti Singh - 1 month ago 6x
PHP Question

When does a cookie with expiration time 'At end of session' expire?

There is a session cookie with expiration time which says 'At end of session'.
When exactly does it expire or will it be alive forever?


When you use setcookie, you can either set the expiration time to 0 or simply omit the parametre - the cookie will then expire at the end of session (ie, when you close the browser).