Documentation
¶
Overview ¶
Package sessions implements the bult-in sessions handler of orujo.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
An Options object contains the properties of the cookie that will be used to store the user session. See the documentation of the package "github.com/gorilla/sessions" for details.
type SessionHandler ¶
type SessionHandler struct {
// contains filtered or unexported fields
}
A SessionHandler is a orujo built-in handler that provides session management features.
func NewSessionHandler ¶
func NewSessionHandler(name string, secret []byte) SessionHandler
NewSessionHandler returns a new SessionHandler. name is used to set the sesion name. secret is used to specify the key used to authenticate the session.
func (SessionHandler) Options ¶
func (h SessionHandler) Options() *Options
Options retrieves the options of the cookie that stores the user session.
func (SessionHandler) ServeHTTP ¶
func (h SessionHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP generates a new session id if the user does not own one yet.
func (SessionHandler) SessionID ¶
func (h SessionHandler) SessionID(r *http.Request) (string, error)
SessionID retrieves the session id of the current user.
func (SessionHandler) SetOptions ¶
func (h SessionHandler) SetOptions(opts *Options)
SetOptions sets the options for the cookie that will store the user session.