Documentation ¶
Index ¶
- type GobSerializer
- type IStore
- type JSONSerializer
- type SessionSerializer
- type Store
- func (s *Store) Close() error
- func (s *Store) Delete(r *http.Request, w http.ResponseWriter, session *sessions.Session) (err error)
- func (s *Store) Get(r *http.Request, name string) (*sessions.Session, error)
- func (s *Store) New(r *http.Request, name string) (sess *sessions.Session, err error)
- func (s *Store) Options(options sssions.Options)
- func (s *Store) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GobSerializer ¶
type GobSerializer struct{}
GobSerializer uses gob package to encode the session map
func (GobSerializer) Deserialize ¶
func (s GobSerializer) Deserialize(d []byte, ss *sessions.Session) error
Deserialize back to map[interface{}]interface{}
type JSONSerializer ¶
type JSONSerializer struct{}
JSONSerializer encode the session map to JSON.
func (JSONSerializer) Deserialize ¶
func (s JSONSerializer) Deserialize(d []byte, ss *sessions.Session) (err error)
Deserialize back to map[string]interface{}
type SessionSerializer ¶
type SessionSerializer interface { Deserialize(d []byte, ss *sessions.Session) error Serialize(ss *sessions.Session) ([]byte, error) }
SessionSerializer provides an interface hook for alternative serializers
type Store ¶
type Store struct { Codecs []securecookie.Codec DefaultMaxAge int // default Redis TTL for a MaxAge == 0 session // contains filtered or unexported fields }
Store stores sessions in a redis backend.
func (*Store) Delete ¶
func (s *Store) Delete(r *http.Request, w http.ResponseWriter, session *sessions.Session) (err error)
Delete removes the session from redis, and sets the cookie to expire.
WARNING: This method should be considered deprecated since it is not exposed via the gorilla/sessions interface. Set session.Options.MaxAge = -1 and call Save instead. - July 18th, 2013
func (*Store) Get ¶
Get returns a session for the given name after adding it to the registry. See gorilla/sessions FilesystemStore.Get().