diff options
author | Paul Oranje <p.oranje@xs4all.nl> | 2015-05-02 10:44:17 +0200 |
---|---|---|
committer | Paul Oranje <p.oranje@xs4all.nl> | 2015-05-02 10:44:17 +0200 |
commit | ae8e971eef2be269beab9465139869055918d878 (patch) | |
tree | 5314a2d5b494884271d8900cba6afc348952279b /modules/luci-mod-admin-full/luasrc/controller/admin/index.lua | |
parent | 4742d1c2112ace9d1299c69fb086c1646bb04911 (diff) | |
parent | 36879e9e8658601dc3e86ff9251da3fc3666efe0 (diff) |
Merge branch 'master' of https://github.com/openwrt/luci into proto=ipv6+aiccu+fixes
Diffstat (limited to 'modules/luci-mod-admin-full/luasrc/controller/admin/index.lua')
-rw-r--r-- | modules/luci-mod-admin-full/luasrc/controller/admin/index.lua | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/modules/luci-mod-admin-full/luasrc/controller/admin/index.lua b/modules/luci-mod-admin-full/luasrc/controller/admin/index.lua index 74a3fd9adc..d00d546b64 100644 --- a/modules/luci-mod-admin-full/luasrc/controller/admin/index.lua +++ b/modules/luci-mod-admin-full/luasrc/controller/admin/index.lua @@ -28,13 +28,17 @@ end function action_logout() local dsp = require "luci.dispatcher" local utl = require "luci.util" - if dsp.context.authsession then - utl.ubus("session", "destroy", { - ubus_rpc_session = dsp.context.authsession - }) + local sid = dsp.context.authsession + + if sid then + utl.ubus("session", "destroy", { ubus_rpc_session = sid }) + dsp.context.urltoken.stok = nil + + luci.http.header("Set-Cookie", "sysauth=%s; expires=%s; path=%s/" %{ + sid, 'Thu, 01 Jan 1970 01:00:00 GMT', dsp.build_url() + }) end - luci.http.header("Set-Cookie", "sysauth=; path=" .. dsp.build_url()) luci.http.redirect(luci.dispatcher.build_url()) end |