added logout

This commit is contained in:
Stephen McQuay 2013-02-26 23:19:21 -08:00
parent a8ff26af15
commit da59b397fc

View File

@ -26,9 +26,9 @@ func loginHandler(w http.ResponseWriter, req *http.Request) {
} }
func logoutHandler(w http.ResponseWriter, req *http.Request) { func logoutHandler(w http.ResponseWriter, req *http.Request) {
session, _ := store.Get(req, "creds") session, _ := store.Get(req, "creds")
delete(session.Values, "logged in") delete(session.Values, "logged in")
session.Save(req, w) session.Save(req, w)
http.Redirect(w, req, "/", http.StatusSeeOther) http.Redirect(w, req, "/", http.StatusSeeOther)
return return
} }