From 509a3daadbfcd9cbe550ff9c70a6f7af55dd2a0f Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Sun, 14 Dec 2008 21:43:05 +0000 Subject: Kill session on logout --- modules/admin-full/luasrc/controller/admin/index.lua | 6 ++++++ modules/admin-mini/luasrc/controller/mini/index.lua | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'modules') diff --git a/modules/admin-full/luasrc/controller/admin/index.lua b/modules/admin-full/luasrc/controller/admin/index.lua index 071dd595d..c0322d3a2 100644 --- a/modules/admin-full/luasrc/controller/admin/index.lua +++ b/modules/admin-full/luasrc/controller/admin/index.lua @@ -49,6 +49,12 @@ function index() end function action_logout() + local dsp = require "luci.dispatcher" + local sauth = require "luci.sauth" + if dsp.context.authsession then + sauth.kill(dsp.context.authsession) + end + luci.http.header("Set-Cookie", "sysauth=; path=/") luci.http.redirect(luci.dispatcher.build_url()) end \ No newline at end of file diff --git a/modules/admin-mini/luasrc/controller/mini/index.lua b/modules/admin-mini/luasrc/controller/mini/index.lua index b538310aa..dad6ccfab 100644 --- a/modules/admin-mini/luasrc/controller/mini/index.lua +++ b/modules/admin-mini/luasrc/controller/mini/index.lua @@ -40,6 +40,12 @@ function index() end function action_logout() + local dsp = require "luci.dispatcher" + local sauth = require "luci.sauth" + if dsp.context.authsession then + sauth.kill(dsp.context.authsession) + end + luci.http.header("Set-Cookie", "sysauth=; path=/") luci.http.redirect(luci.dispatcher.build_url()) end \ No newline at end of file -- cgit v1.2.3