xjsession

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

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

Session

type SessionMgr

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

SessionMgr session manager

func NewSessionMgr

func NewSessionMgr(sessionName string, maxLifeTime int64) *SessionMgr

NewSessionMgr create session manager

func (*SessionMgr) CheckCookieValid

func (mgr *SessionMgr) CheckCookieValid(w http.ResponseWriter, r *http.Request) (string, error)

CheckCookieValid check cookie is valid or not

func (*SessionMgr) EndSession

func (mgr *SessionMgr) EndSession(w http.ResponseWriter, r *http.Request)

EndSession

func (*SessionMgr) EndSessionByID

func (mgr *SessionMgr) EndSessionByID(sessionID string)

EndSessionByID end the session by session ID

func (*SessionMgr) GetSessionValue

func (mgr *SessionMgr) GetSessionValue(sessionID string, key interface{}) (interface{}, error)

GetSessionValue get value fo session

func (*SessionMgr) NewSession

func (mgr *SessionMgr) NewSession(w http.ResponseWriter, r *http.Request) string

NewSession create session

func (*SessionMgr) NewSessionID

func (mgr *SessionMgr) NewSessionID() string

NewSessionID generate unique ID

func (*SessionMgr) SessionGC

func (mgr *SessionMgr) SessionGC()

SessionGC maintain session

func (*SessionMgr) SetSessionValue

func (mgr *SessionMgr) SetSessionValue(sessionID string, key interface{}, value interface{}) error

SetSessionValue set value fo session

Jump to

Keyboard shortcuts

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