From 9cd7ad34b33a7a4e511867b917c02af971a95536 Mon Sep 17 00:00:00 2001 From: hoteas Date: Wed, 21 Jul 2021 00:09:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=8F=E8=A7=88=E5=99=A8co?= =?UTF-8?q?okie=E4=B8=8D=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application.go | 4 +++- example/config/config.json | 2 +- example/config/configNote.json | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/application.go b/application.go index d6a1c0b..efc5fc9 100644 --- a/application.go +++ b/application.go @@ -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 } diff --git a/example/config/config.json b/example/config/config.json index 5437206..4a1f7ea 100644 --- a/example/config/config.json +++ b/example/config/config.json @@ -14,7 +14,7 @@ "mysql": { "host": "192.168.6.253", "name": "hotimego", - "password": "root", + "password": "dasda8454456", "port": "3306", "prefix": "", "user": "root" diff --git a/example/config/configNote.json b/example/config/configNote.json index 77545b2..61a3f09 100644 --- a/example/config/configNote.json +++ b/example/config/configNote.json @@ -20,6 +20,10 @@ }, "注释": "可配置memory,db,redis,默认启用memory,默认优先级为memory\u003eredis\u003edb,memory与数据库缓存设置项一致,缓存数据填充会自动反方向反哺,加入memory缓存过期将自动从redis更新,但memory永远不会更新redis,如果是集群建议不要开启memory,配置即启用" }, + "codeConfig": { + "packageName": "默认无,必须,包名称以及应用名,生成代码的配置文件地址,比如config/app.json,数据库有更新时自动更新配置文件以及对应的生成文件", + "注释": "配置即启用,非必须,默认无" + }, "crossDomain": "默认空 非必须,空字符串为不开启,如果需要跨域设置,auto为智能开启所有网站允许跨域,http://www.baidu.com为指定域允许跨域", "db": { "mysql": {