Sfoglia il codice sorgente

flush and destroy session at logout

Yoginth 7 anni fa
parent
commit
7ea9a68e69
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  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)