diff options
author | Nathan Angelacos <nangel@tetrasec.net> | 2007-11-14 22:08:31 +0000 |
---|---|---|
committer | Nathan Angelacos <nangel@tetrasec.net> | 2007-11-14 22:08:31 +0000 |
commit | 4d69d93c131b3dfd0e3c321da67e62ab44e42293 (patch) | |
tree | df86697f1b5c14dc819041bb96f8d1d26e42ded5 | |
parent | 358a60a3f7d7ded7c5b3c16d808eb269a2e58d46 (diff) | |
download | acf-core-4d69d93c131b3dfd0e3c321da67e62ab44e42293.tar.bz2 acf-core-4d69d93c131b3dfd0e3c321da67e62ab44e42293.tar.xz |
Session cookie gets written, session table gets stored (working)
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@305 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r-- | app/acf_www-controller.lua | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/app/acf_www-controller.lua b/app/acf_www-controller.lua index ef52bc2..97fb6bb 100644 --- a/app/acf_www-controller.lua +++ b/app/acf_www-controller.lua @@ -33,28 +33,34 @@ mvc.on_load = function (self, parent) local session=require ("session") self.session = {} + local tempid = "" if self.clientdata.sessionid == nil then - self.session.id = session.random_hash(512) - end - local timestamp - timestamp, self.session = session.load_session(self.conf.sessiondir, - self.clientdata.sessionid) - if timestamp == nil then - -- FIXME ... need to add this function - -- record an invalid sessionid event + self.session.id = session.random_hash(512) + tempid = self.session.id else - --[[ - FIXME --- need to write this function - if too many bad events for this ip invaidate the session + tempid = self.session.id + + local timestamp + timestamp, self.session = session.load_session(self.conf.sessiondir, + self.clientdata.sessionid) + if timestamp == nil then + -- FIXME ... need to add this function + -- record an invalid sessionid event + self.session.id = tempid + else + --[[ + FIXME --- need to write this function + if too many bad events for this ip invaidate the session - if (timestamp is > 10 minutes old) - session.unlink.session (self.conf.sessiondir, - self.session.id) - self.session = {} - self.session.id = session.random_hash(512) - generate flash message "Inactivity logout" + if (timestamp is > 10 minutes old) + session.unlink.session (self.conf.sessiondir, + self.session.id) + self.session = {} + self.session.id = session.random_hash(512) + generate flash message "Inactivity logout" + end + ]]-- end - ]]-- end end |