sessions

package
v0.1.0-round1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package sessions defines persistence for authenticated browser sessions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Record

type Record struct {
	CSRFToken string
	ExpiresAt time.Time
}

Record contains server-side session state that is safe to return to the authenticated browser. Implementations must not persist the raw bearer token.

type Store

type Store interface {
	Create(context.Context, string, Record) error
	Load(context.Context, string, time.Time) (Record, bool, error)
	Delete(context.Context, string) error
}

Store persists browser sessions across web process restarts.

Tokens are opaque bearer credentials supplied by an untrusted cookie. Store implementations must expire a record at or before its ExpiresAt time and must remove it on Delete.

Jump to

Keyboard shortcuts

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