s.store.Get() returns a new session when returning an error for gorilla session's CookieStore.
// Get returns a session for the given name after adding it to the registry.
//
// It returns a new session if the sessions doesn't exist. Access IsNew on
// the session to check if it is an existing session or a new one.
//
// It returns a new session and an error if the session exists but could
// not be decoded.
In 1.0.2, Session() would use this new session. In 1.0.3, Session() returns nil.
This behavior was changed here.
Most of the callers in sessions.go (such as ID()) are not written to handle Session() returning nil.
s.store.Get()returns a new session when returning an error for gorilla session'sCookieStore.In 1.0.2,
Session()would use this new session. In 1.0.3,Session()returnsnil.This behavior was changed here.
Most of the callers in
sessions.go(such asID()) are not written to handleSession()returningnil.