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