MCPcopy
hub / github.com/gorilla/sessions / Get

Method Get

store.go:81–83  ·  view source on GitHub ↗

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.

(r *http.Request, name string)

Source from the content-addressed store, hash-verified

79// It returns a new session and an error if the session exists but could
80// not be decoded.
81func (s *CookieStore) Get(r *http.Request, name string) (*Session, error) {
82 return GetRegistry(r).Get(s, name)
83}
84
85// New returns a session for the given name without adding it to the registry.
86//

Callers 1

TestFlashesFunction · 0.95

Calls 2

GetRegistryFunction · 0.85
GetMethod · 0.65

Tested by 1

TestFlashesFunction · 0.76