cookie

package
v0.0.0-...-dd27f12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2015 License: MIT, Zlib Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear(w http.ResponseWriter, r *http.Request, name string)

Clear deletes the cookie with the given name.

func Decode

func Decode(cookie *http.Cookie, secret string) string

DecodeStr returns the given signed cookie value if it validates, else returns an empty string.

func DecodeStr

func DecodeStr(value, secret string) string

DecodeStr returns the given signed value if it validates, else returns an empty string.

func Sign

func Sign(cookie *http.Cookie, secret string, expires time.Time)

Sign signs and timestamps a cookie so it cannot be forged.

func SignStr

func SignStr(value, secret string, expires time.Time) string

SignStr signs and timestamps a string so it cannot be forged.

Normally used via Sign, but provided as a separate method for non-cookie uses. To decode a value not stored as a cookie use the DecodeStr function.

Types

This section is empty.

Directories

Path Synopsis
Package authcookie implements creation and verification of signed authentication cookies.
Package authcookie implements creation and verification of signed authentication cookies.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL