How long do sessions last?

The sessions on my website don’t seem to be destroyed as soon as the website is closed, I was wondering if this has anything to do with InfinityFree?

Hi and welcome to the forum

Please provide the URL of the website and more information.

Until then, maybe this will be of use to you:

or the opposite


Ahh, figured it out with the help of this post.
Turns out InfinityFree sets the default timer for the ‘PHPSESSID’ cookie at 24 hours, and to change it you override the cookie using the session_set_cookie_params(); function and set the expiry timer to 0 causing it to destroy when the browser closes.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.