SESSIONS-IN-DATABASE SUPPORT

Support for a new configuration variable called $CFG->dbsessions
which enables sessions via database.  Based on code from Jason Cole's
team - thanks!
This commit is contained in:
moodler
2004-09-30 06:02:39 +00:00
parent 855c11a67b
commit 42b90599be
7 changed files with 77 additions and 19 deletions
+11
View File
@@ -601,6 +601,17 @@ function main_upgrade($oldversion=0) {
if ($oldversion < 2004092000) { //redoing this just to be sure that column type is text (postgres type changes didnt work when this was done first time)
table_column("config", "value", "value", "text", "", "", "");
}
if ($oldversion < 2004093001) { // add new table for sessions storage
execute_sql(" CREATE TABLE {$CFG->prefix}sessions (
sesskey char(32) PRIMARY KEY,
expiry integer NOT null,
expireref varchar(64),
data text NOT null
);");
execute_sql(" CREATE INDEX {$CFG->prefix}sessions_expiry_idx ON {$CFG->prefix}sessions (expiry)");
}
return $result;