cookie

package
v7.0.0-...-1c7ecba Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCookieSessionStore

func NewCookieSessionStore(opts *options.SessionOptions, cookieOpts *options.Cookie) (sessions.SessionStore, error)

NewCookieSessionStore initialises a new instance of the SessionStore from the configuration given

Types

type SessionStore

type SessionStore struct {
	Cookie       *options.Cookie
	CookieCipher encryption.Cipher
	Minimal      bool
}

SessionStore is an implementation of the sessions.SessionStore interface that stores sessions in client side cookies

func (*SessionStore) Clear

func (s *SessionStore) Clear(rw http.ResponseWriter, req *http.Request) error

Clear clears any saved session information by writing a cookie to clear the session

func (*SessionStore) Load

func (s *SessionStore) Load(req *http.Request) (*sessions.SessionState, error)

Load reads sessions.SessionState information from Cookies within the HTTP request object

func (*SessionStore) Save

Save takes a sessions.SessionState and stores the information from it within Cookies set on the HTTP response writer

func (*SessionStore) VerifyConnection

func (s *SessionStore) VerifyConnection(_ context.Context) error

VerifyConnection always return no-error, as there's no connection in this store

Jump to

Keyboard shortcuts

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