d014ccfb by Pengfei Xue

bug fix, session stored in redis cannot be deleted

1 parent 1509a6b6
......@@ -398,6 +398,7 @@ func (c *Controller) SessionRegenerateID() {
// DestroySession cleans session data and session cookie.
func (c *Controller) DestroySession() {
c.Ctx.Input.CruSession.Flush()
GlobalSessions.SessionDestroy(c.Ctx.ResponseWriter, c.Ctx.Request)
}
......
......@@ -60,6 +60,11 @@ func (rs *RedisSessionStore) SessionID() string {
}
func (rs *RedisSessionStore) SessionRelease(w http.ResponseWriter) {
// if rs.values is empty, return directly
if len(rs.values) < 1 {
return
}
c := rs.p.Get()
defer c.Close()
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!