Fix clearing of session cookie after 9a43bfc5bb.

This commit is contained in:
Mihai Parparita 2014-10-20 22:43:23 -07:00
parent 4e2076a98d
commit bb8c898f97

View file

@ -191,7 +191,9 @@ func indexHandler(w http.ResponseWriter, r *http.Request) {
account, err := getAccount(c, userId)
if account == nil {
// Can't look up the account, session cookie must be invalid, clear it.
indexUrl, _ := router.Get("sign-out").URL()
session.Options.MaxAge = -1
session.Save(r, w)
indexUrl, _ := router.Get("index").URL()
http.Redirect(w, r, indexUrl.String(), http.StatusFound)
return
}