Welcome Guest, Not a member yet? Register   Sign In
Expiring the session when the browser is closed
#1

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?
Reply
#2

PHP - Session destroy after closing browser
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(This post was last modified: 01-07-2021, 11:09 PM by iot.)

(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?
Reply
#4

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

(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 ?
Reply
#6

(This post was last modified: 01-11-2021, 01:45 AM by cantinsertdata.)

(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
Reply
#7

Thank you
Reply
#8

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




Theme © iAndrew 2016 - Forum software by © MyBB