From 545fba8c810af5d472743df762f585737878b2fd Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 28 Jul 2011 12:49:33 +0100 Subject: [PATCH] Adding table specs. --- SessionHandler.pm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/SessionHandler.pm b/SessionHandler.pm index 7481433..e32e4f9 100644 --- a/SessionHandler.pm +++ b/SessionHandler.pm @@ -60,6 +60,33 @@ # of view of using the id as part of session id calculation. The extra argument # allows the addition of an arbitrary string to the seed used to create the # id. +# +# This class requires two database tables: one for sessions, one for session keys (used +# for autologin). The tables should be as follows: +# +# A session table, the name of which is stored in the configuration as {"database"} -> {"sessions"}: +# CREATE TABLE `sessions` ( +# `session_id` char(32) NOT NULL, +# `session_user_id` mediumint(9) unsigned NOT NULL, +# `session_start` int(11) unsigned NOT NULL, +# `session_time` int(11) unsigned NOT NULL, +# `session_ip` varchar(40) NOT NULL, +# `session_autologin` tinyint(1) unsigned NOT NULL, +# PRIMARY KEY (`session_id`), +# KEY `session_time` (`session_time`), +# KEY `session_user_id` (`session_user_id`) +# ) DEFAULT CHARSET=utf8 COMMENT='Website sessions'; +# +# A session key table, the name of which is in {"database"} -> {"keys"} +# CREATE TABLE `session_keys` ( +# `key_id` char(32) COLLATE utf8_bin NOT NULL DEFAULT '', +# `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0', +# `last_ip` varchar(40) COLLATE utf8_bin NOT NULL DEFAULT '', +# `last_login` int(11) unsigned NOT NULL DEFAULT '0', +# PRIMARY KEY (`key_id`,`user_id`), +# KEY `last_login` (`last_login`) +# ) DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Autologin keys'; +# package SessionHandler; require 5.005;