sessions

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: GPL-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SessionMiddleware

func SessionMiddleware(store *scs.SessionManager) mux.Middleware

Add a session to the request.

Types

type Session

type Session interface {
	Set(key string, value interface{})
	Get(key string) interface{}
	Exists(key string) bool
	Delete(key string)
	Destroy() error
	RenewToken() error
	AddFinalizer(finalizer func(r *http.Request, ctx context.Context) (context.Context, error))
}

This interface will be set on the request's context.

func Retrieve

func Retrieve(r *http.Request) Session

Retrieve a session for the request.

Makes the session globally available, and avoids import cycles.

func SessionFromContext added in v1.4.4

func SessionFromContext(ctx context.Context) Session

SessionFromContext retrieves the session from the context.

Jump to

Keyboard shortcuts

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