Documentation ¶
Index ¶
- func Cookie(r *http.Request, name string) (*http.Cookie, error)
- func Remove(w http.ResponseWriter, r *http.Request, name string) error
- func Reset(w http.ResponseWriter, r *http.Request, name, value string) error
- func Set(w http.ResponseWriter, name, value, path string, expires time.Time)
- func SetCookie(w http.ResponseWriter, cookie *http.Cookie)
- func SetValue(w http.ResponseWriter, name, value string)
- func SetValueExpires(w http.ResponseWriter, name, value string, expires time.Time)
- func SetValueMaxAge(w http.ResponseWriter, name, value string, maxAge int)
- func Value(r *http.Request, name string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cookie ¶
Cookie returns the named cookie provided in the request or http.ErrNoCookie if not found.
func Reset ¶
Reset reset a cookie specified by name, only modify the value property, other attributes remain unchanged.
func Set ¶
func Set(w http.ResponseWriter, name, value, path string, expires time.Time)
Set adds a cookie to a user's browser with a name, value, path and expiry.
func SetCookie ¶
func SetCookie(w http.ResponseWriter, cookie *http.Cookie)
SetCookie adds a Set-Cookie header to the provided ResponseWriter's headers.
func SetValue ¶
func SetValue(w http.ResponseWriter, name, value string)
SetValue adds a cookie to a user's browser with a name, value.
func SetValueExpires ¶
func SetValueExpires(w http.ResponseWriter, name, value string, expires time.Time)
SetValueExpires adds a cookie to a user's browser with a name, value and expires.
func SetValueMaxAge ¶
func SetValueMaxAge(w http.ResponseWriter, name, value string, maxAge int)
SetValueMaxAge adds a cookie to a user's browser with a name, value and maxAge. 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
Types ¶
This section is empty.