Skip to content

Commit

Permalink
fix can't not clear session
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfmin committed May 28, 2012
1 parent d0c63e3 commit 79a2553
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sessions.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,12 @@ func sessionCookieValue(env Env, key string) (value string) {
func cookieChanged(env Env, key, secret string) string {
oldCookieValue := sessionCookieValue(env, key)
value := env["mango.session"].(map[string]interface{})
if len(value) == 0 {

// old and new both are empty
if oldCookieValue == "" && len(value) == 0 {
return ""
}

newCookieValue := encodeCookie(value, secret)
if oldCookieValue == newCookieValue {
return ""
Expand Down

0 comments on commit 79a2553

Please sign in to comment.