cookie

package
v3.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package cookie centralizes cookie policy shared by Fiber core and middleware.

Index

Constants

View Source
const (
	SameSiteDisabled = "disabled"
	SameSiteLax      = "Lax"
	SameSiteStrict   = "Strict"
	SameSiteNone     = "None"
)

SameSite mode names accepted by Fiber's cookie APIs.

Variables

This section is empty.

Functions

func FormatSameSite

func FormatSameSite(mode fasthttp.CookieSameSite) string

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.

Types

type SameSite

type SameSite struct {
	HTTPMode       http.SameSite
	FastHTTPMode   fasthttp.CookieSameSite
	RequiresSecure bool
}

SameSite maps one Fiber SameSite mode to the cookie implementations Fiber validates with and writes through.

func ParseSameSite

func ParseSameSite(value string) (SameSite, bool)

ParseSameSite parses value case-insensitively. Unsupported values return the Lax mapping and false, allowing callers to choose fallback or rejection.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL