HOT-FIX/incorrect-redis-setex, fix: modified invalid redis setex and setxx command in sess_redis.go
This commit is contained in:
parent
17e916f4a0
commit
5a457f1b1c
@ -119,9 +119,9 @@ func (rs *SessionStore) releaseSession(_ http.ResponseWriter, requirePresent boo
|
|||||||
}
|
}
|
||||||
c := rs.p.Get()
|
c := rs.p.Get()
|
||||||
if requirePresent {
|
if requirePresent {
|
||||||
c.Do("SETXX", rs.sid, string(b), time.Duration(rs.maxlifetime)*time.Second, "XX")
|
c.Do("SET", rs.sid, string(b), "EX", time.Duration(rs.maxlifetime)*time.Second, "XX")
|
||||||
} else {
|
} else {
|
||||||
c.Do("SETEX", rs.sid, string(b), time.Duration(rs.maxlifetime)*time.Second)
|
c.Do("SET", rs.sid, string(b), "EX", time.Duration(rs.maxlifetime)*time.Second)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user