mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 12:40:55 +00:00
bug fix, session stored in redis cannot be deleted
This commit is contained in:
parent
1509a6b681
commit
d014ccfb8e
@ -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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user