From a0c8b22db4a098b8216a6c9f00bf54a00538305c Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Mon, 12 Mar 2018 00:36:00 +0200 Subject: [PATCH] When storing new value in session use `New` If using `Get` after `Logout` has set `MaxAge` to `-1` it will stay so and value won't be saved to session. Fixes #192 --- gothic/gothic.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gothic/gothic.go b/gothic/gothic.go index 6412ad7b9..7d6ac2ab6 100644 --- a/gothic/gothic.go +++ b/gothic/gothic.go @@ -286,7 +286,7 @@ func getProviderName(req *http.Request) (string, error) { // StoreInSession stores a specified key/value pair in the session. func StoreInSession(key string, value string, req *http.Request, res http.ResponseWriter) error { - session, _ := Store.Get(req, SessionName) + session, _ := Store.New(req, SessionName) if err := updateSessionValue(session, key, value); err != nil { return err