开始新增代码生成配置2.0功能,配置文件格式规定完成
This commit is contained in:
+7
-3
@@ -298,9 +298,13 @@ 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+";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")
|
||||
//没有跨域设置
|
||||
if that.Config.GetString("crossDomain") == "" {
|
||||
http.SetCookie(w, &http.Cookie{Name: that.Config.GetString("sessionName"), Value: sessionId, Path: "/"})
|
||||
} else {
|
||||
//跨域允许需要设置cookie的允许跨域
|
||||
w.Header().Set("Set-Cookie", that.Config.GetString("sessionName")+"="+sessionId+"; SameSite=None; Secure")
|
||||
}
|
||||
} else {
|
||||
sessionId = cookie.Value
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user