Shakti Singh Shakti Singh - 3 months ago 11
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?

Answer

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

Comments