sessions

package
v0.0.0-...-8b413d3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2015 License: BSD-3-Clause Imports: 6 Imported by: 0

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

type Options sessions.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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL