CodeIgniter Forums
Expiring the session when the browser is closed - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Expiring the session when the browser is closed (/showthread.php?tid=78360)



Expiring the session when the browser is closed - iot - 01-07-2021

Hello,
Thank you for reading my question.

I am updating from CI3 to CI4.

To expire when the browser is closed, I set $sessionExpiration = 0 in /Config/App.php, but it does not work. The session is expired after some minute without closing browser. Could anyone please tell me how to solve it?


RE: Expiring the session when the browser is closed - InsiteFX - 01-07-2021

PHP - Session destroy after closing browser


RE: Expiring the session when the browser is closed - iot - 01-07-2021

(01-07-2021, 10:00 PM)InsiteFX Wrote: PHP - Session destroy after closing browser

I want my system works as: an user will not be logged out until the browser is closed. If the browser is not closed, the user is kept logged in

In previous CI version (CI 3), with the config: $config['sess_expiration'] = 0;. It works as expected.

Now, when I upgrade the system to CI4. I use $sessionExpiration = 0;, but it does not worked as expected. User is automallicaly logged out after a few minutes.

Could you please tell me a solution for it?


RE: Expiring the session when the browser is closed - paulbalandan - 01-08-2021

This is a bug in v4.0.4 and was fixed in the latest develop. Please wait for the next release.


RE: Expiring the session when the browser is closed - iot - 01-10-2021

(01-08-2021, 01:37 AM)paulbalandan Wrote: This is a bug in v4.0.4 and was fixed in the latest develop. Please wait for the next release.

Thank you very much. Could you please tell me somewhere to subscribe to receive the notification when it is released ?


RE: Expiring the session when the browser is closed - cantinsertdata - 01-11-2021

(01-10-2021, 04:40 PM)iot Wrote:
(01-08-2021, 01:37 AM)paulbalandan Wrote: This is a bug in v4.0.4 and was fixed in the latest develop. Please wait for the next release.

Thank you very much. Could you please tell me somewhere to subscribe to receive the notification when it is released ?

The official GitHub repository is probably as good of a place as any. If you sign in you can click the little watch button up near the top, and then you can either choose All Notifications or go to Custom and just check the box for new releases. This should alert you on GitHub and via email.

edit: link to save you time: https://github.com/codeigniter4/CodeIgniter4


RE: Expiring the session when the browser is closed - iot - 01-11-2021

Thank you


RE: Expiring the session when the browser is closed - danger89 - 10-09-2022

Using CI v4.2.7. Setting `$sessionExpiration` to 0 in App.php still keeps the session alive between browser closes?