session

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSession

func GetSession(w http.ResponseWriter, r *http.Request) (session memory.SessionStore)

Session中间件 判断当前请求的cookie中是否存在有效的session,存在返回,否则创建

func Init

func Init()

初始化,创建容器

Types

type Config

type Config struct {
	Sessname   string `toml:"sessname"`
	Expiration int    `toml:"expiration"`
	SaveFile   string `toml:"savefile_path"`
	SaveCycle  int    `toml:"savefile_cycle"`
	Enable     bool   `toml:"enable"`
}

type Manager

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

func (*Manager) GC

func (manager *Manager) GC()

垃圾回收机制

func (*Manager) SessionDestroy

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

销毁session 同时删除cookie

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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