session secret fix

This commit is contained in:
bunkerity
2020-10-16 17:31:53 +02:00
parent c1d44387b5
commit ccf4392280
4 changed files with 12 additions and 5 deletions

View File

@@ -3,11 +3,10 @@ local M = {}
local session = require "resty.session"
function M.session ()
local s = session:open()
if not s.started then
s:start()
if not ngx.ctx.session then
ngx.ctx.session = session:start()
end
return s
return ngx.ctx.session
end
function M.is_set (key)