Documentation
¶
Index ¶
- type Config
- type Module
- func (m *Module) ClearSession(c *gin.Context)
- func (m *Module) DelValue(c *gin.Context, key string)
- func (m *Module) GetSessionJSON(c *gin.Context) (*SessionJSON, error)
- func (m *Module) GetValue(c *gin.Context, key string) (v interface{}, exist bool)
- func (m *Module) GetValueString(c *gin.Context, key string) string
- func (Module) NewSession() (SessionJSON, error)
- func (m *Module) SetValue(c *gin.Context, key string, v interface{})
- func (m *Module) StartSession(c *gin.Context, noCheckCsrf bool)
- func (m *Module) UpdateSessionInfo(c *gin.Context, sessInfo *user.Session, sessJson *SessionJSON)
- func (m *Module) UpdateSessionJSON(c *gin.Context, sessJson *SessionJSON)
- type SessionJSON
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
func (*Module) GetSessionJSON ¶
func (m *Module) GetSessionJSON(c *gin.Context) (*SessionJSON, error)
func (*Module) GetValueString ¶
按字符串格式读取一个session值
func (Module) NewSession ¶
func (Module) NewSession() (SessionJSON, error)
func (*Module) StartSession ¶
对一个request启动session
func (*Module) UpdateSessionInfo ¶
func (*Module) UpdateSessionJSON ¶
func (m *Module) UpdateSessionJSON(c *gin.Context, sessJson *SessionJSON)
type SessionJSON ¶
type SessionJSON struct { CSRF string `json:"csrf"` // 用来防止Cross-site request forgery攻击(多窗口浏览器的cookie安全问题) Data map[string]interface{} `json:"data"` }
SessionJSON is used for marshalling and unmarshalling custom session json information. We're using it as an opportunity to tie csrf strings to sessions to prevent csrf attacks
Click to show internal directories.
Click to hide internal directories.