Documentation
¶
Index ¶
- func Delete(w http.ResponseWriter, name string)
- func Get(r *http.Request, key string) *http.Cookie
- func GetCryptoCookie(req *http.Request, k string) string
- func GetValue(r *http.Request, key string) string
- func Set(w http.ResponseWriter, name, value string)
- func SetCodec(ck, hashKey, blockKey []byte)
- func SetCryptoCookie(w http.ResponseWriter, key, value string, maxAge int) (err error)
- func SetWithExpires(w http.ResponseWriter, name, value string, expires int64)
- type Optionals
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(w http.ResponseWriter, name string)
func Set ¶
func Set(w http.ResponseWriter, name, value string)
func SetCryptoCookie ¶ added in v1.4.1
func SetCryptoCookie(w http.ResponseWriter, key, value string, maxAge int) (err error)
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
}
Click to show internal directories.
Click to hide internal directories.