Skip to content

Commit

Permalink
When storing new value in session use New
Browse files Browse the repository at this point in the history
If using `Get` after `Logout` has set `MaxAge` to `-1` it will stay so and value won't be saved to session. Fixes #192
  • Loading branch information
lafriks authored Mar 11, 2018
1 parent f3fc9dc commit a0c8b22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gothic/gothic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a0c8b22

Please sign in to comment.