Use SETEX command to set session
In order to be compatible with older version Redis, use `SETEX` command instead of `SET x y EX 360`.
Showing
1 changed file
with
1 additions
and
1 deletions
| ... | @@ -109,7 +109,7 @@ func (rs *RedisSessionStore) SessionRelease(w http.ResponseWriter) { | ... | @@ -109,7 +109,7 @@ func (rs *RedisSessionStore) SessionRelease(w http.ResponseWriter) { |
| 109 | return | 109 | return |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | c.Do("SET", rs.sid, string(b), "EX", rs.maxlifetime) | 112 | c.Do("SETEX", rs.sid, rs.maxlifetime, string(b)) |
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | // redis session provider | 115 | // redis session provider | ... | ... |
-
Please register or sign in to post a comment