cookies

package
v0.260.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrValueTooLong = errors.New("cookie value too long")
	ErrInvalidValue = errors.New("invalid cookie value")
	ErrReadFail     = errors.New("read cookie failed")
	ErrWriteFail    = errors.New("write cookie failed")
)

Functions

func Read

func Read(r *http.Request, name string) (string, error)

Read will read the cookie from the request.

func ReadEncrypted

func ReadEncrypted(r *http.Request, name string, secretKey []byte) (string, error)

ReadEncrypted will read an encrypted cookie from the request.

func Write

func Write(res http.ResponseWriter, cookie http.Cookie) error

Write will write the given cookie to the response.

func WriteEncrypted

func WriteEncrypted(res http.ResponseWriter, cookie http.Cookie, secretKey []byte) error

WriteEncrypted will write an encrypted cookie to the response.

Types

This section is empty.

Jump to

Keyboard shortcuts

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