internal/cookie
import "github.com/gofiber/fiber/v3/internal/cookie"
Package cookie centralizes cookie policy shared by Fiber core and middleware.
Constants
SameSite mode names accepted by Fiber's cookie APIs.
Source: internal/cookie/samesite.go:13
const (
SameSiteDisabled = "disabled"
SameSiteLax = "Lax"
SameSiteStrict = "Strict"
SameSiteNone = "None"
)Functions
func FormatSameSite(mode fasthttp.CookieSameSite) string
Source: internal/cookie/samesite.go:63
FormatSameSite names the Fiber SameSite mode a fasthttp cookie carries, inverting ParseSameSite for every mode Fiber writes. fasthttp's default mode has no Fiber name and returns an empty string.
func ParseSameSite(value string) (SameSite, bool)
Source: internal/cookie/samesite.go:29
ParseSameSite parses value case-insensitively. Unsupported values return the Lax mapping and false, allowing callers to choose fallback or rejection.
Types
type SameSite
Source: internal/cookie/samesite.go:21
SameSite maps one Fiber SameSite mode to the cookie implementations Fiber validates with and writes through.
type SameSite struct {
HTTPMode http.SameSite
FastHTTPMode fasthttp.CookieSameSite
RequiresSecure bool
}Fields
HTTPMode http.SameSiteFastHTTPMode fasthttp.CookieSameSiteRequiresSecure bool