session

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomCookieStore

type CustomCookieStore struct {
	*sessions.CookieStore
}

func NewCustomCookieStore

func NewCustomCookieStore(keyPairs ...[]byte) *CustomCookieStore

Set secureCookie maxLength to an arbitrary (20x4kb) high value since we are no longer limited

func (*CustomCookieStore) Get

func (s *CustomCookieStore) Get(r *http.Request, name string) (*sessions.Session, error)

func (*CustomCookieStore) New

func (s *CustomCookieStore) New(r *http.Request, name string) (*sessions.Session, error)

In contrast to default implementation, the session values can be partitioned into multiple cookies. The original cookie is split/joined in its encoded form

func (*CustomCookieStore) Save

If the cookie length is > maxCookieLength, its value is split into multiple cookies fitting into the maxCookieLength limit. The resulting section cookies get their index appended to the name.

type Session

type Session struct {
	Session *CustomCookieStore
}

Session defines a Gangplank session

func New

func New(sessionSecurityKey string) *Session

New inits a Session with CookieStore

func (*Session) Cleanup

func (s *Session) Cleanup(w http.ResponseWriter, r *http.Request, name string)

Cleanup removes the current session from the store

Jump to

Keyboard shortcuts

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