GetSecureCookie retrieves the secure cookie encoder from the context.
(ctx context.Context)
| 42 | |
| 43 | // GetSecureCookie retrieves the secure cookie encoder from the context. |
| 44 | func 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 | } |