mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 12:10:55 +00:00
session: fix #688
This commit is contained in:
parent
e6d6419a65
commit
1858f3073b
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user