Skip to content

Instantly share code, notes, and snippets.

@lolsborn
Created November 2, 2012 20:59
Show Gist options
  • Save lolsborn/4004266 to your computer and use it in GitHub Desktop.
Save lolsborn/4004266 to your computer and use it in GitHub Desktop.
Go session issue
func Logout(w http.ResponseWriter, r *http.Request) {
s, _ := Store.Get(r, SESSION_NAME)
s.Options = &sessions.Options{
MaxAge: -1,
}
s.Values["active"] = false // This is still true!??
s.Save(r, w)
http.Redirect(w, r, "/login/", 302)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment