Versions in this module Expand all Collapse all v2 v2.0.2 Sep 3, 2024 Changes in this version + var ErrCookie = errors.New("cookie failure") + var ErrEncryption = errors.New("encryption failure") + var ErrInitiation = errors.New("initialization failure") + var ErrSecretMissing = errors.New("secret key is missing") + func NewCookieSecret() ([]byte, error) + func Read(r *http.Request, name string) (string, error) + func ReadEncrypted(r *http.Request, name string, secretKey []byte) (int, string, error) + func ReadSigned(r *http.Request, name string, secretKey []byte) (string, error) + func Write(w http.ResponseWriter, cookie http.Cookie) error + func WriteEncrypted(w http.ResponseWriter, userID int, cookie http.Cookie, secretKey []byte) error + func WriteSigned(w http.ResponseWriter, cookie http.Cookie, secretKey []byte) error + type Cookie struct + Domain string + Expires time.Time + HttpOnly bool + MaxAge int + Name string + Path string + Raw string + RawExpires string + SameSite http.SameSite + Secure bool + Unparsed []string + Value string Other modules containing this package github.com/ddbgio/cookie