bug fix, session stored in redis cannot be deleted
Showing
2 changed files
with
6 additions
and
0 deletions
| ... | @@ -398,6 +398,7 @@ func (c *Controller) SessionRegenerateID() { | ... | @@ -398,6 +398,7 @@ func (c *Controller) SessionRegenerateID() { |
| 398 | 398 | ||
| 399 | // DestroySession cleans session data and session cookie. | 399 | // DestroySession cleans session data and session cookie. |
| 400 | func (c *Controller) DestroySession() { | 400 | func (c *Controller) DestroySession() { |
| 401 | c.Ctx.Input.CruSession.Flush() | ||
| 401 | GlobalSessions.SessionDestroy(c.Ctx.ResponseWriter, c.Ctx.Request) | 402 | GlobalSessions.SessionDestroy(c.Ctx.ResponseWriter, c.Ctx.Request) |
| 402 | } | 403 | } |
| 403 | 404 | ... | ... |
| ... | @@ -60,6 +60,11 @@ func (rs *RedisSessionStore) SessionID() string { | ... | @@ -60,6 +60,11 @@ func (rs *RedisSessionStore) SessionID() string { |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | func (rs *RedisSessionStore) SessionRelease(w http.ResponseWriter) { | 62 | func (rs *RedisSessionStore) SessionRelease(w http.ResponseWriter) { |
| 63 | // if rs.values is empty, return directly | ||
| 64 | if len(rs.values) < 1 { | ||
| 65 | return | ||
| 66 | } | ||
| 67 | |||
| 63 | c := rs.p.Get() | 68 | c := rs.p.Get() |
| 64 | defer c.Close() | 69 | defer c.Close() |
| 65 | 70 | ... | ... |
-
Please register or sign in to post a comment