From 1858f3073b97822a3e827be7258d052d19a6485f Mon Sep 17 00:00:00 2001 From: astaxie Date: Wed, 16 Jul 2014 23:05:38 +0800 Subject: [PATCH] session: fix #688 --- session/couchbase/sess_couchbase.go | 6 ------ session/memcache/sess_memcache.go | 5 ----- session/redis/sess_redis.go | 6 ------ 3 files changed, 17 deletions(-) diff --git a/session/couchbase/sess_couchbase.go b/session/couchbase/sess_couchbase.go index 7d15654d..8066e338 100644 --- a/session/couchbase/sess_couchbase.go +++ b/session/couchbase/sess_couchbase.go @@ -75,12 +75,6 @@ func (cs *CouchbaseSessionStore) SessionID() string { func (cs *CouchbaseSessionStore) SessionRelease(w http.ResponseWriter) { defer cs.b.Close() - // if rs.values is empty, return directly - if len(cs.values) < 1 { - cs.b.Delete(cs.sid) - return - } - bo, err := session.EncodeGob(cs.values) if err != nil { return diff --git a/session/memcache/sess_memcache.go b/session/memcache/sess_memcache.go index 8712743a..0175b6ba 100644 --- a/session/memcache/sess_memcache.go +++ b/session/memcache/sess_memcache.go @@ -72,11 +72,6 @@ func (rs *MemcacheSessionStore) SessionID() string { // save session values to redis func (rs *MemcacheSessionStore) SessionRelease(w http.ResponseWriter) { defer rs.c.Close() - // if rs.values is empty, return directly - if len(rs.values) < 1 { - rs.c.Delete(rs.sid) - return - } b, err := session.EncodeGob(rs.values) if err != nil { diff --git a/session/redis/sess_redis.go b/session/redis/sess_redis.go index 13527f15..8368dbc0 100644 --- a/session/redis/sess_redis.go +++ b/session/redis/sess_redis.go @@ -81,12 +81,6 @@ func (rs *RedisSessionStore) SessionRelease(w http.ResponseWriter) { c := rs.p.Get() defer c.Close() - // if rs.values is empty, return directly - if len(rs.values) < 1 { - c.Do("DEL", rs.sid) - return - } - b, err := session.EncodeGob(rs.values) if err != nil { return