Heavily improved sessions

This commit is contained in:
2017-06-17 22:19:26 +02:00
parent 340f4d1f9c
commit 15e2717ea8
5 changed files with 18 additions and 6 deletions

View File

@ -9,7 +9,10 @@ func Install(app *aero.Application) {
// Logout
app.Get("/logout", func(ctx *aero.Context) string {
ctx.Session().Set("userId", nil)
if ctx.HasSession() {
ctx.Session().Set("userId", nil)
}
return ctx.Redirect("/")
})
}