diff --git a/handlers/auth.go b/handlers/auth.go index e047e1e..e83e98c 100644 --- a/handlers/auth.go +++ b/handlers/auth.go @@ -56,6 +56,7 @@ func (h *Handler) Logout(w http.ResponseWriter, r *http.Request) { // Clear the session data session.Values = make(map[interface{}]interface{}) + session.Options.MaxAge = -1 // Save the empty session err = session.Save(r, w) @@ -63,12 +64,5 @@ func (h *Handler) Logout(w http.ResponseWriter, r *http.Request) { return } - http.SetCookie(w, &http.Cookie{ - Name: "user-session", // or whatever your session name is - Value: "", - Path: "/", - MaxAge: -1, // This deletes the cookie - }) - http.Redirect(w, r, "/", http.StatusFound) } diff --git a/tmp/main b/tmp/main index 63f356b..fd62d69 100755 Binary files a/tmp/main and b/tmp/main differ