package cookie
import "golang.org/x/pkgsite/internal/cookie"
Package cookie is used to get and set HTTP cookies.
Index ¶
- Constants
- func Base64Value(c *http.Cookie) (string, error)
- func Extract(w http.ResponseWriter, r *http.Request, name string) (_ string, err error)
- func Set(w http.ResponseWriter, name, val, urlPath string)
Constants ¶
const AlternativeModuleFlash = "tmp-redirected-from-alternative-module"
AlternativeModuleFlash indicates the alternative module path that a request was redirected from.
Functions ¶
func Base64Value ¶
Base64Value decodes the value of c using the Base64 URL encoding and returns it as a string.
func Extract ¶
Extract returns the value of the cookie at name and deletes the cookie.
func Set ¶
func Set(w http.ResponseWriter, name, val, urlPath string)
Set sets a cookie at the urlPath with name and val.
Source Files ¶
flash.go
- Version
- v0.0.0-20250218150137-224a1368cf02 (latest)
- Published
- Feb 18, 2025
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 2 months ago –
Tools for package owners.