Преглед изворни кода

flush and destroy session at logout

Yoginth пре 7 година
родитељ
комит
7ea9a68e69
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      routes/user/auth.go

+ 2 - 2
routes/user/auth.go

@@ -295,8 +295,8 @@ func LoginTwoFactorRecoveryCodePost(c *context.Context) {
 
 //SignOut is the handler for "/user/logout"
 func SignOut(c *context.Context) {
-	c.Session.Delete("uid")
-	c.Session.Delete("uname")
+	c.Session.Flush()
+	c.Session.Destory(c.Context)
 	c.SetCookie(setting.CookieUserName, "", -1, setting.AppSubURL)
 	c.SetCookie(setting.CookieRememberName, "", -1, setting.AppSubURL)
 	c.SetCookie(setting.CSRFCookieName, "", -1, setting.AppSubURL)