cookie

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SecretBytes

func SecretBytes(secret string) []byte

SecretBytes attempts to base64 decode the secret, if that fails it treats the secret as binary

func SignedValue

func SignedValue(seed string, key string, value []byte, now time.Time) (string, error)

SignedValue returns a cookie that is signed and can later be checked with Validate

func Validate

func Validate(cookie *http.Cookie, seed string, expiration time.Duration) (value []byte, t time.Time, ok bool)

Validate ensures a cookie is properly signed

Types

This section is empty.

Jump to

Keyboard shortcuts

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