Documentation ¶
Overview ¶
Package websession provides session management.
Index ¶
- type Session
- func (s *Session) AuthenticatedUser(r *http.Request) (string, error)
- func (s *Session) CSRF(r *http.Request, token string) bool
- func (s *Session) DeleteSessionValue(r *http.Request, name string)
- func (s *Session) Login(r *http.Request, value string)
- func (s *Session) Logout(r *http.Request)
- func (s *Session) LogoutAll(r *http.Request) error
- func (s *Session) Persist(r *http.Request, persist bool)
- func (s *Session) SessionValue(r *http.Request, name string) string
- func (s *Session) SetCSRF(r *http.Request) string
- func (s *Session) SetSessionValue(r *http.Request, name string, value string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct { Name string // contains filtered or unexported fields }
Session stores session level information
func (*Session) AuthenticatedUser ¶
AuthenticatedUser returns the user ID if authenticated or an error.
func (*Session) CSRF ¶
CSRF return true if the cross site request forgery token matches what was stored before form submission.
func (*Session) DeleteSessionValue ¶
DeleteSessionValue deletes a value in the user session.
func (*Session) SessionValue ¶
SessionValue returns a value stored in the user session.
Click to show internal directories.
Click to hide internal directories.