Permalink
Browse files

fix can't not clear session

  • Loading branch information...
1 parent d0c63e3 commit 79a2553db18c45be0fc7b838b1759dc37961bd20 @sunfmin sunfmin committed May 28, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 sessions.go
View
5 sessions.go
@@ -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 ""

0 comments on commit 79a2553

Please sign in to comment.