Forum Moderators: coopster

Message Too Old, No Replies

PHP Site Log-out

         

SeanF

5:18 pm on Jan 8, 2020 (gmt 0)

5+ Year Member Top Contributors Of The Month



Hi:

I have a Secure site built on PHP/MySQL that has a secure login function.

I have not written any sort of time-out / hibernate function that will log a user out after some period of inactivity. However, for some users, they get logged out automatically if they are inactive for a short period of time.

What is causing this?

What can I do to control it (disable it)?

Thanks

w3dk

5:46 pm on Jan 8, 2020 (gmt 0)

10+ Year Member Top Contributors Of The Month



This really depends on how a user is "logged in" - what criteria decides whether a user is logged in or not?

If the user's logged-in state is simply dependent on a token in the PHP session, then PHP sessions will (by default) expire after 24 minutes of no activity.

SeanF

6:43 pm on Jan 8, 2020 (gmt 0)

5+ Year Member Top Contributors Of The Month



Ah, Good to know. Thanks

Is there a way I can change that?

lammert

8:00 pm on Jan 9, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



This 24 minutes timeout is controlled by session.gc_maxlifetime in the php.ini file.

JorgeV

3:19 pm on Jan 12, 2020 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



if the session id is not part of the URL, then it's stored in a cookie. Cooikies also have a life time, after which the browser deletes them.