MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / GetSecureCookie

Function GetSecureCookie

pkg/webmiddleware/cookie.go:44–50  ·  view source on GitHub ↗

GetSecureCookie retrieves the secure cookie encoder from the context.

(ctx context.Context)

Source from the content-addressed store, hash-verified

42
43// GetSecureCookie retrieves the secure cookie encoder from the context.
44func GetSecureCookie(ctx context.Context) (*securecookie.SecureCookie, error) {
45 secureCookie, _ := ctx.Value(secureCookieCtxKey).(*securecookie.SecureCookie)
46 if secureCookie == nil {
47 return nil, errInvalidContext.New()
48 }
49 return secureCookie, nil
50}

Callers 4

GetMethod · 0.92
SetMethod · 0.92
CookieAuthFunction · 0.85
TestCookiesFunction · 0.85

Calls 2

NewMethod · 0.65
ValueMethod · 0.45

Tested by 1

TestCookiesFunction · 0.68