cookie

package
v1.3.12 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(w http.ResponseWriter, name string)

func Get

func Get(r *http.Request, key string) *http.Cookie

func GetValue

func GetValue(r *http.Request, key string) string

func Set

func Set(w http.ResponseWriter, name, value string)

func SetWithExpires

func SetWithExpires(w http.ResponseWriter, name, value string, expires int64)

Types

type Optionals

type Optionals struct {
	Path       string    // optional
	Domain     string    // optional
	Expires    time.Time // optional
	RawExpires string    // for reading cookies only

	// 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
	SameSite http.SameSite
}

Jump to

Keyboard shortcuts

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