func Logout(c *gin.Context) { session := sessions.Default(c) session.Delete("internal") session.Delete(gin.AuthUserKey) SessionSave(c) c.Redirect(http.StatusTemporaryRedirect, "/") }
func SessionSave(c *gin.Context) { session := sessions.Default(c) session.Delete("internal") session.Save() }
func GetSession(c *gin.Context) sessions.Session { session := sessions.Default(c) return session }
func SessionGet(c *gin.Context, key interface{}) interface{} { session := sessions.Default(c) return session.Get(key) }
func SessionSet(c *gin.Context, key interface{}, value interface{}) { session := sessions.Default(c) session.Set(key, value) }