fix: 解决浏览器关闭后重新打开不需要登录验证的问题 (#1180)

This commit is contained in:
ssongliu 2023-05-29 17:32:55 +08:00 committed by GitHub
parent 7c0327c1b8
commit 10684f9aac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,7 +109,7 @@ func (u *AuthService) generateSession(c *gin.Context, name, authMethod string) (
sessionUser, err := global.SESSION.Get(sID)
if err != nil {
sID = uuid.New().String()
c.SetCookie(constant.SessionName, sID, 604800, "", "", false, false)
c.SetCookie(constant.SessionName, sID, 0, "", "", false, false)
err := global.SESSION.Set(sID, sessionUser, lifeTime)
if err != nil {
return nil, err