cookie

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package cookie provides a cookie-based login.AttemptStore. The attempt travels in a signed and encrypted cookie (gorilla/securecookie), so no server-side state is required — suitable for multi-instance deployments that share the same keys.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is a cookie-based login attempt store. Data is signed and encrypted via gorilla/securecookie, meeting the login.Attempt requirement of an authenticated client token.

func New

func New(hashKey, blockKey []byte) (*Store, error)

New creates a cookie-based login attempt store. hashKey must be 32 or 64 bytes; blockKey must be 16, 24, or 32 bytes.

func (*Store) Clear

func (s *Store) Clear(_ *http.Request, w http.ResponseWriter, _ string) error

func (*Store) Get

func (s *Store) Get(r *http.Request, userID string) (login.Attempt, error)

func (*Store) Set

Jump to

Keyboard shortcuts

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