MCPcopy Create free account
hub / github.com/authorizerdev/authorizer / SetSession

Function SetSession

internal/cookie/cookie.go:29–34  ·  view source on GitHub ↗

SetSession sets the session cookie in the response.

(gc *gin.Context, sessionID string, appCookieSecure bool, sameSite http.SameSite)

Source from the content-addressed store, hash-verified

27
28// SetSession sets the session cookie in the response.
29func SetSession(gc *gin.Context, sessionID string, appCookieSecure bool, sameSite http.SameSite) {
30 for _, c := range BuildSessionCookies(parsers.GetHost(gc), sessionID, appCookieSecure, sameSite) {
31 gc.SetSameSite(c.SameSite)
32 gc.SetCookie(c.Name, c.Value, c.MaxAge, c.Path, c.Domain, c.Secure, c.HttpOnly)
33 }
34}
35
36// BuildSessionCookies returns the pair of session cookies (host-scoped and
37// domain-scoped) to set on the response. Transport-agnostic so non-gin

Callers 4

VerifyEmailHandlerMethod · 0.92
OAuthCallbackHandlerMethod · 0.92
AuthorizeHandlerMethod · 0.92
TokenHandlerMethod · 0.92

Calls 2

GetHostFunction · 0.92
BuildSessionCookiesFunction · 0.85

Tested by

no test coverage detected