[pmwiki-users] persistence of login (hello?)

Patrick R. Michaud pmichaud at pobox.com
Mon Jul 10 14:06:27 CDT 2006


On Mon, Jul 10, 2006 at 10:24:23AM +1000, Kathryn Andersen wrote:
> Posting this again, since it seems to have dropped off the radar.
> 
> I am running PmWiki for our intranet at work, and users have been
> complaining that they keep on getting logged out; they want the login to
> last as long as the browser is open, but they log in, do stuff, and then
> come back the next day to find that they've been logged out again.

I don't know of an obvious way to do this.  PmWiki uses PHP sessions
to manage most of its login information, and by default PHP expires 
sessions after approximately 24 minutes of inactivity.

Which indirectly points to one possibility -- perhaps you can change
PHP's session settings to keep track of logins over a longer 
period of time.  To do this you'd probably want to make the following
settings in the php.ini:

    session.gc_maxlifetime = 604800     # 7 days
    session.cookie_lifetime = 2592000   # 30 days
    
The session.gc_maxlifetime causes PHP to keep sessions around for 
at least a week, which means that the session will remain active 
as long as someone accesses the wiki at least once per week.

The second setting causes the PHP session cookie (used to keep
track of the browser and map to the session) to last for 30 
days.  Thus, after 30 days the browser would be prompted to
log in again.

Of course, either of these settings could be made larger or smaller
as desired.  On the other hand, if the server is being used for
PHP scripts other than PmWiki, it's probably a good idea to localize 
them to take effect only for the wiki (probably within the Apache 
webserver configuration).

You might want to also change the value of session.save_path so that
these extended sessions are saved (and garbage collected) from somewhere
other than the default directory that is shared by other PHP
scripts on the server.

I can provide more information, but it would be good to know if
you think these changes can be reliably made site-wide, or if
it would be better to have a PmWiki-only solution (e.g., via changes
in config.php).

Hope this helps,

Pm




More information about the pmwiki-users mailing list