Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CookieStore ¶
type CookieStore struct {
// contains filtered or unexported fields
}
CookieStore represents the currently configured session store.
func New ¶
func New(key []byte, oldKeys ...[]byte) *CookieStore
New returns a new CookieStore instance.
The key parameter should contain the secret you want to use to authenticate and encrypt session cookies. This should be exactly 32 bytes long.
Optionally, the variadic oldKeys parameter can be used to provide an arbitrary number of old Keys. This should be used to ensure that valid cookies continue to work correctly after key rotation.
func (*CookieStore) Delete ¶
func (c *CookieStore) Delete(token string) error
Delete is a no-op. The function exists only to ensure that a CookieStore instance satisfies the scs.Store interface.
func (*CookieStore) Find ¶
func (c *CookieStore) Find(token string) (b []byte, exists bool, error error)
Find returns the session data for given cookie token. It loops through all available keys (including old keys) to try to decode the cookie. If the cookie could not be decoded, or has expired, the returned exists flag will be set to false.