This recipe allows users to stay logged in for several days.
The above code should be placed after the
<?php line, and after any line containing
The recipe should be the first included in (farm)config.php if possible, notably before AuthUser.
3. Edit your wiki page
[[Site.AuthForm]] and place the following line before the final
(:input checkbox persistentlogin 1:) $[Remember me]
When you log in, check the box "Remember me".
Here are the settings you can customize in (farm)config.php, before including the script:
# Where to save session files, preferably inaccessible via HTTP $PersistentSessionDir = "directory"; # default "
$WorkDir/.sessions" # How many days of inactivity "expire" logged in users $PersistentSessionDays = 10 ; # default 3
On some Debian-derived systems, if old session files stay in your wiki.d/.sessions directory, add also this line:
If your wiki has more than one language, you can translate the "Remember me" string. Set in your XLPage the following (eg. for French):
'Remember me' => "Rester connecté",
- The users are kept permanently logged in, but if they do not visit the wiki for 3 days or more, they are logged out.
- Persistent logins are less secure. Never use the "Remember me" checkbox on computers which may be used by other people.
- Your browser/proxy should allow persistent cookies (some do not).
- 20091122 - Fix for PHP 5.3 installations.
- 20090711 - First public release.
- PITS:01083 Add persistent authorization option
- FixShortSessions How to fix short sessions so you aren't prompted frequently for a password
- UserAuth2 A user-based permission granting and authentication module
- Recipe written and maintained by Petko.