cookies

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetCookie

func SetCookie(
	writer http.ResponseWriter,
	name string,
	value string,
	cookieConfig CookieConfig,
)

Types

type CookieConfig

type CookieConfig struct {
	Path    string        // optional
	Domain  string        // optional
	Expires time.Duration // optional

	// MaxAge=0 means no 'Max-Age' attribute specified.
	// MaxAge<0 means delete cookie now, equivalently 'Max-Age: 0'
	// MaxAge>0 means Max-Age attribute present and given in seconds
	MaxAge   int
	Secure   bool
	HTTPOnly bool

	//	SameSiteDefaultMode SameSite = iota + 1 (1)
	//	SameSiteLaxMode (2)
	//	SameSiteStrictMode (3)
	//	SameSiteNoneMode (4)
	SameSite http.SameSite
}

type CookieNotFoundError

type CookieNotFoundError struct {
	Message string
	BaseErr error
}

func (CookieNotFoundError) Error

func (e CookieNotFoundError) Error() string

Jump to

Keyboard shortcuts

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