Closed hashwing closed 6 years ago
If you are using cookie
storage, you really cannot do that. If you are using Server Side storage, e.g. redis, then you can just remove key sessions:<id>
(the prefix can be changed though).
Thanks! I do it :
local sid = ngx.var.arg_sid
local session = require "resty.session".new({ storage = "shm" })
local s = session.start()
if sid ~= nil then
s.storage:destroy(ngx.decode_base64(sid))
else
s:destroy()
end
How to open session by session id? For example, I want to destroy session by session id.