added reset

This commit is contained in:
sm
2014-12-07 21:57:41 -08:00
parent e60f255522
commit d1f1cfcd67
4 changed files with 60 additions and 27 deletions
+7
View File
@@ -135,3 +135,10 @@ func attempt(w http.ResponseWriter, req *http.Request) {
log.Fatal("cannot marshal solution", err)
}
}
func reset(w http.ResponseWriter, req *http.Request) {
session, _ := store.Get(req, "Score")
session.Values["Score"] = 0
session.Save(req, w)
http.Redirect(w, req, "/", http.StatusFound)
}