Kill session on logout

This commit is contained in:
Steven Barth 2008-12-14 21:43:05 +00:00
parent 8b978f79fc
commit 509a3daadb
2 changed files with 12 additions and 0 deletions

View file

@ -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

View file

@ -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