From 1eb9aef687bca35f09574b647eef4582686fe6dd Mon Sep 17 00:00:00 2001 From: Brandon Gao Date: Thu, 16 Oct 2014 20:16:17 +0800 Subject: [PATCH] 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`. --- session/redis/sess_redis.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session/redis/sess_redis.go b/session/redis/sess_redis.go index f2b0b29b..82cdd812 100644 --- a/session/redis/sess_redis.go +++ b/session/redis/sess_redis.go @@ -109,7 +109,7 @@ func (rs *RedisSessionStore) SessionRelease(w http.ResponseWriter) { return } - c.Do("SET", rs.sid, string(b), "EX", rs.maxlifetime) + c.Do("SETEX", rs.sid, rs.maxlifetime, string(b)) } // redis session provider