Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MultiCookie ¶
type MultiCookie struct {
Codecs []securecookie.Codec
// Options are use to default cookie options
Options *sessions.Options
}
MultiCookie is a gorilla session store that saves each value to individual cookies, rather than to a single cookie. This enables larger values to be saved. All cookies are prefixed with `<sessionname>-`, it is the responsibility of the application to avoid conflict. Otherwise, it works similar to the built-in cookie store.
func New ¶
func New(keyPairs ...[]byte) *MultiCookie
New returns a new MultiCookie.
The key options are the same as github.com/gorilla/sessions#NewCookieStore
func (*MultiCookie) MaxAge ¶
func (m *MultiCookie) MaxAge(age int)
MaxAge sets the maximum age for the store and the underlying cookie implementation. Individual sessions can be deleted by setting Options.MaxAge = -1 for that session.
func (*MultiCookie) New ¶
New should create and return a new session.
Note that New should never return a nil session, even in the case of an error if using the Registry infrastructure to cache the session.
func (*MultiCookie) Save ¶
func (m *MultiCookie) Save(r *http.Request, w http.ResponseWriter, s *sessions.Session) error
Save should persist session to the underlying store implementation.