Page 1 of 1
Unexpected timeout
Posted: Fri Sep 11, 2009 2:53 am
by devesa
Hello colleagues,
I have put these lines in the header of my php webpage:
Code: Select all
<?php ini_set('session.gc_maxlifetime',"50000");
session_start(); ?>
But it takes less than an hour to logout automatically (I suposse for inactivity).
What am I doing wrong?
Thanks
Re: Unexpected timeout
Posted: Fri Sep 11, 2009 3:50 am
by jazz090
this is the worst way to logout users automatically. what you need to do is set a timestamp on a db column and every time a user makes an action the requires authorisation, you update that field and simultaneous you check that timestamp against current time and if its been too long, then you log them out.
Re: Unexpected timeout
Posted: Fri Sep 11, 2009 4:06 am
by devesa
Thanks for your fast reply, but I didn't explain properly.
I really do not want them to log-out automatically. In fact this is a problem for me.
I want to set the automatic timeout as long as possible (that's why I set session.gc_maxlifetime to 50000).
But it doesn't log-out after 50000 seconds, but long befor (about an hour after log-in), and I do not know why...
Thanks!