Kill session on logout
authorSteven Barth <steven@midlink.org>
Sun, 14 Dec 2008 21:43:05 +0000 (21:43 +0000)
committerSteven Barth <steven@midlink.org>
Sun, 14 Dec 2008 21:43:05 +0000 (21:43 +0000)
modules/admin-full/luasrc/controller/admin/index.lua
modules/admin-mini/luasrc/controller/mini/index.lua

index 071dd595d38f0049e432d69b0b71dee52987fc63..c0322d3a2e876d19a6dca2f795737da21d6d925c 100644 (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
\ No newline at end of file
index b538310aa083758c99cfc538b4daa8369b6ca610..dad6ccfab3db10ffdefafc2a1954fcb0fb8d9b03 100644 (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
\ No newline at end of file