summaryrefslogtreecommitdiff
path: root/modules/admin-full/luasrc/controller/admin/index.lua
diff options
context:
space:
mode:
Diffstat (limited to 'modules/admin-full/luasrc/controller/admin/index.lua')
-rw-r--r--modules/admin-full/luasrc/controller/admin/index.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/admin-full/luasrc/controller/admin/index.lua b/modules/admin-full/luasrc/controller/admin/index.lua
index 071dd595d3..e2b812e8c3 100644
--- a/modules/admin-full/luasrc/controller/admin/index.lua
+++ b/modules/admin-full/luasrc/controller/admin/index.lua
@@ -49,6 +49,13 @@ function index()
end
function action_logout()
- luci.http.header("Set-Cookie", "sysauth=; path=/")
+ local dsp = require "luci.dispatcher"
+ local sauth = require "luci.sauth"
+ if dsp.context.authsession then
+ sauth.kill(dsp.context.authsession)
+ dsp.context.urltoken.stok = nil
+ end
+
+ luci.http.header("Set-Cookie", "sysauth=; path=" .. dsp.build_url())
luci.http.redirect(luci.dispatcher.build_url())
end \ No newline at end of file