Documentation ¶
Index ¶
- type Options
- type Session
- func (s *Session) Delete(w http.ResponseWriter, r *http.Request, key string) interface{}
- func (s *Session) Flash(w http.ResponseWriter, r *http.Request, key string, value interface{})
- func (s *Session) Flashes(w http.ResponseWriter, r *http.Request) map[string]interface{}
- func (s *Session) Get(r *http.Request, key string) interface{}
- func (s *Session) List(r *http.Request) map[string]interface{}
- func (s *Session) Reset(w http.ResponseWriter, r *http.Request)
- func (s *Session) Set(w http.ResponseWriter, r *http.Request, key string, value interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { // The name of the cookie (default is "_session"). Name string // MaxAge of the cookie before expiry (default is 365 days). Set it to // -1 for no expiry. MaxAge int }
Options to customize the behaviour of the session.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
A Session manages setting and getting data from the cookie that stores the session data.
func (*Session) Get ¶
Session creates a new session from the given HTTP request. If the request already has a cookie with an associated session, the session data is created from the cookie. If not, a new session is created.
Click to show internal directories.
Click to hide internal directories.