Skip to content

Breaking change in 1.0.3: if s.store.Get returns an error, Session() returns nil. #287

@alan-anzenna

Description

@alan-anzenna

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions