pkgsitegolang.org/x/pkgsite/internal/cookie Index | Files

package cookie

import "golang.org/x/pkgsite/internal/cookie"

Package cookie is used to get and set HTTP cookies.

Index

Constants

const AlternativeModuleFlash = "tmp-redirected-from-alternative-module"

AlternativeModuleFlash indicates the alternative module path that a request was redirected from.

Functions

func Base64Value

func Base64Value(c *http.Cookie) (string, error)

Base64Value decodes the value of c using the Base64 URL encoding and returns it as a string.

func Extract

func Extract(w http.ResponseWriter, r *http.Request, name string) (_ string, err error)

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-20250523174444-0e6de173c6b5 (latest)
Published
May 23, 2025
Platform
linux/amd64
Imports
5 packages
Last checked
1 month ago

Tools for package owners.