coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: mister2k on October 13, 2008, 09:59:59 PM

Title: Auto logout
Post by: mister2k on October 13, 2008, 09:59:59 PM
Is there any possibility in settings or a script or anything else that users auto logout after x minutes?
Title: Re: Auto logout
Post by: Joachim Müller on October 14, 2008, 08:18:06 AM
You could modify the life-time of the cookie, but usually the session lasts at least untill the browser is closed. A real by-minute logout would have to be coded: you'd have to record the time the user logged in in the database and then perform a check against that date on each action the user makes.
Out of the box, there is no such functionality, nor do I think that a mod exists that does what you're up to.
Title: Re: Auto logout
Post by: amitbhalerao on October 14, 2008, 09:22:32 AM
When a user logs in, there is an entry in ..sessions table with the login time and it is updated(on user activities). If the logged in user is inactive for an hour, this entry gets deleted and user auto logs out..

If this is to be changed, we can add..

define('CPG_AUTO',1800);
after
define('CPG_HOUR',3600);
in include/logger.inc.php

AND

replace CPG_HOUR with CPG_AUTO..
in bridge/coppermine.inc.php (find $session_life_time in function sesison_extraction())..

This will make the default timeout 30 min..
Title: Re: Auto logout
Post by: amitbhalerao on October 14, 2008, 09:43:20 AM
Quotethis entry gets deleted and user auto logs out..
The entry is not deleted. In fact the user_id is reset to '0' (guest).

Sorry for the spell mistakes..
Quotefunction sesison_extraction()
should be.
Quotefunction session_extraction()

-Amit