MCPcopy Index your code
hub / github.com/ZenNotes/zennotes / sessionCookie

Method sessionCookie

apps/server/internal/httpserver/security.go:400–413  ·  view source on GitHub ↗
(r *http.Request, token string, expiresAt time.Time)

Source from the content-addressed store, hash-verified

398}
399
400func (s *Server) sessionCookie(r *http.Request, token string, expiresAt time.Time) *http.Cookie {
401 cookie := &http.Cookie{
402 Name: sessionCookieName,
403 Value: token,
404 Path: "/api",
405 HttpOnly: true,
406 SameSite: http.SameSiteStrictMode,
407 Expires: expiresAt,
408 }
409 if s.effectiveScheme(r) == "https" {
410 cookie.Secure = true
411 }
412 return cookie
413}
414
415func (s *Server) clearSessionCookie(r *http.Request) *http.Cookie {
416 cookie := s.sessionCookie(r, "", time.Unix(0, 0))

Callers 2

clearSessionCookieMethod · 0.95
sessionLoginMethod · 0.95

Calls 1

effectiveSchemeMethod · 0.95

Tested by

no test coverage detected