Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

PersistentLogin

Summary: Login form with "Remember me" option
Version: 20091122
Prerequisites:
Status: Experimental
Maintainer: Petko

Description

This recipe allows users to stay logged in for several days.

Installation

1. Place persistentlogin.phpΔ to your cookbook directory (alt.download: persistentlogin.php).
2. Place the following code near the top of your (farm)config.php:

 include_once("$FarmD/cookbook/persistentlogin.php");

The above code should be placed after the <?php line, and after any line containing session_save_path.

3. Edit your wiki page [[Site.AuthForm]] and place the following line before the final (:input end:):

 (:input checkbox persistentlogin 1:) $[Remember me]

Usage

When you log in, check the box "Remember me".

Configuration

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

Notes

  • The recipe is experimental.
  • 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).

Release notes

  • 20091122 - Fix for PHP 5.3 installations.
  • 20090711 - First public release.

See also

  • 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

Author

  • Recipe written and maintained by Petko.

Comments

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.

Edit - History - Print - Recent Changes - Search
Page last modified on September 10, 2011, at 11:42 AM