示例#1
0
文件: auth.go 项目: sankark/kyp
func Logout(c *gin.Context) {
	session := sessions.Default(c)
	session.Delete("internal")
	session.Delete(gin.AuthUserKey)
	SessionSave(c)
	c.Redirect(http.StatusTemporaryRedirect, "/")
}
示例#2
0
文件: auth.go 项目: sankark/kyp
func SessionSave(c *gin.Context) {
	session := sessions.Default(c)
	session.Delete("internal")
	session.Save()
}
示例#3
0
文件: auth.go 项目: sankark/kyp
func GetSession(c *gin.Context) sessions.Session {
	session := sessions.Default(c)
	return session
}
示例#4
0
文件: auth.go 项目: sankark/kyp
func SessionGet(c *gin.Context, key interface{}) interface{} {
	session := sessions.Default(c)
	return session.Get(key)
}
示例#5
0
文件: auth.go 项目: sankark/kyp
func SessionSet(c *gin.Context, key interface{}, value interface{}) {
	session := sessions.Default(c)
	session.Set(key, value)
}