session

package
v0.0.0-...-40cb7ec Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const SessionID = "RecoitSessionID"

SessionID 是 session 在 cookie 中的 name.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager 是 session manager.

func NewManager

func NewManager(maxAge int) *Manager

NewManager .

func (*Manager) Add

func (manager *Manager) Add(w http.ResponseWriter, sid string)

Add adds a new sid into manager.store.

func (*Manager) Check

func (manager *Manager) Check(r *http.Request) bool

Check 检查 session 的有效性,有效时返回 true.

func (*Manager) DeleteSID

func (manager *Manager) DeleteSID(w http.ResponseWriter, r *http.Request)

DeleteSID 同时删除 manager.store 中的 sid 并使 session 过期。

Jump to

Keyboard shortcuts

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