session

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InCtx = Middleware

InCtx puts the session in the context

Functions

func AddHelpers

func AddHelpers(next http.Handler) http.Handler

func FromCtx

func FromCtx(ctx context.Context) *sessions.Session

FromCtx returns the session from the context.

func Middleware

func Middleware(secret, name string, options ...Option) func(http.Handler) http.Handler

Middleware that injects the session into the request context and also takes care of saving the session when the response is written to the client by wrapping the response writer.

Types

type Option added in v1.1.3

type Option func(*sessions.CookieStore)

Option for the session middleware

func WithDomain added in v1.1.3

func WithDomain(domain string) Option

Set the domain for the application session This is useful when you want to share the session between subdomains.

Jump to

Keyboard shortcuts

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