Re: Adjusting Session Times

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 14, 2010 at 10:26 AM, Floyd Resler <fresler@xxxxxxxxxxxxx> wrote:
> We just got a client whose requirement is that user sessions expire after 30 minutes of inactivity.  Our other clients are happy with not having their sessions expire during the work day (i.e. life is 8 hours).  I am using a MySQL database to store the session data.  My thought is to adjust the session expiration in the table based on the client currently logged in.  Is this a good approach or would there be better ways to do it?  And just to clarify: all clients use the same Web site.
>
> Thanks!
> Floyd

I store the date and time of the last page access and the session
lifetime in minutes in the database. Then when I fetch the session
from the database, the WHERE clause includes a condition that the
number of minutes elapsed between the current date/time and the time
stored in the session table is less than the session lifetime (maximum
duration of inactivity for that session). That way, each individual
user could have his or her own session timeout period if needed.

Andrew

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux