tags:

views:

37

answers:

2

Quick question - Is there any simple way (module perhaps?) to set the admin account to stay logged in forever?

I admin a bunch of Drupal sites and am getting really tired of constantly logging in after whatever interval it logs out automatically.

+1  A: 

No. The session is a function of your PHP installation (session controls) and your browser (it is a cookie-based session). For security concerns, I would highly recommend not doing that anyway.

Andrew Sledge
Yes thanks. But how is it a security concern if only I stay logged in from only my highly secure computer? - No other computer involved?
Michael D
BTW - I don't think that it's the session cookie at issue, but rather the cookie that keeps track of last login or logout. I don't know which one that is. It allows for user to be logged in automatically if the time interval since last login or logout was less than some particular interval. - I can come back in a day or a week sometimes and not need to login even though it's a new browser session for example...
Michael D
+1  A: 

Use http://drupal.org/project/autologout

You can set the administrator to automatically logout after an insane amount of time (so it effectively becomes forever). Other users can be excluded from this setting so it does not apply to them.

Enable the module and checkout the settings at /admin/settings/autologout

This method is better than tweaking the session expiry related ini options in settings.php because then they apply to everyone and not only administrators. So it would have the bad side effect making everybody stay logged in forever.

P.S. these are the ini settings that determine session expiry in Drupal in settings.php

ini_set('session.cookie_lifetime',  2000000); // in seconds; approx 23 days
ini_set('session.gc_probability', 1); 
ini_set('session.gc_divisor', 100);
// see http://www.php.net/manual/en/ini.list.php for explanations
Sid NoParrots
PERFECT! Thanks so much.
Michael D

related questions