修复浏览器cookie不识别
This commit is contained in:
+3
-1
@@ -298,7 +298,9 @@ func (that *Application) handler(w http.ResponseWriter, req *http.Request) {
|
||||
if len(token) == 32 {
|
||||
sessionId = token
|
||||
}
|
||||
http.SetCookie(w, &http.Cookie{Name: that.Config.GetString("sessionName"), Value: sessionId, Path: "/"})
|
||||
//http.SetCookie(w, &http.Cookie{Name: that.Config.GetString("sessionName"), Value: sessionId+";SameSite=Strict", Path: "/"})
|
||||
//http.SetCookie(w, &http.Cookie{Name: "SameSite", Value: "Strict", Path: "/"})
|
||||
w.Header().Set("Set-Cookie", that.Config.GetString("sessionName")+"="+sessionId+"; SameSite=None; Secure")
|
||||
} else {
|
||||
sessionId = cookie.Value
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user