session

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemorySessionStore

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

MemorySessionStore is an in-memory SessionStore implementation. It survives Caddy config hot-reloads when kept in the usagePool.

func NewMemorySessionStore

func NewMemorySessionStore() *MemorySessionStore

NewMemorySessionStore returns a new in-memory session store and starts a background goroutine that periodically evicts expired sessions.

func (*MemorySessionStore) ClearExpired

func (s *MemorySessionStore) ClearExpired() error

ClearExpired removes all sessions that have passed their expiry time.

func (*MemorySessionStore) Destruct

func (s *MemorySessionStore) Destruct() error

Destruct implements caddy.Destructor — stops the background cleanup goroutine.

func (*MemorySessionStore) GetSession

func (s *MemorySessionStore) GetSession(sessionID string) (*pkgsession.Session, error)

GetSession returns an active session by ID, pruning expired sessions lazily.

func (*MemorySessionStore) RedeemToken

func (s *MemorySessionStore) RedeemToken(signingKey []byte, token string) (*pkgsession.Session, error)

RedeemToken validates the HMAC-signed token and returns the stored session (one-time use).

func (*MemorySessionStore) StoreSession

func (s *MemorySessionStore) StoreSession(session *pkgsession.Session) error

StoreSession persists a newly created session.

Jump to

Keyboard shortcuts

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