Welcome Guest, Not a member yet? Register   Sign In
Session expiration zero
#1

I would like a confirmation regarding session expiries.
The documentation isn't clear or I didn't understand it very well.

In app/Config/Session.php  what would be the results with :
Code:
    public int $expiration = 0;



Quote:The number of seconds you would like the session to last.
If you would like a non-expiring session (until browser is closed) set the value to zero: 0


or

Quote:If expiration is set to 0, the session.gc_maxlifetime setting set by PHP in session management will be used as-is (often the default value of 1440). This needs to be changed in php.ini or via ini_set() as needed.
Reply
#2

Quote:session.gc_maxlifetime specifies the number of seconds after which data will be seen as 'garbage' and potentially cleaned up. Garbage collection may occur during session start (depending on session.gc_probability and session.gc_divisor). Defaults to 1440 (24 minutes).
https://www.php.net/manual/en/session.co...axlifetime

So if you don't change the INI value, the session data on the server may be deleted by the PHP's garbage collection.
If the session data is deleted, of course the session will be lost.

The $expiration is the lifetime of session cookies.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB