forked from golang/hotime
修复浏览器cookie不识别
This commit is contained in:
parent
d736a74198
commit
9cd7ad34b3
@ -298,7 +298,9 @@ func (that *Application) handler(w http.ResponseWriter, req *http.Request) {
|
|||||||
if len(token) == 32 {
|
if len(token) == 32 {
|
||||||
sessionId = token
|
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 {
|
} else {
|
||||||
sessionId = cookie.Value
|
sessionId = cookie.Value
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
"mysql": {
|
"mysql": {
|
||||||
"host": "192.168.6.253",
|
"host": "192.168.6.253",
|
||||||
"name": "hotimego",
|
"name": "hotimego",
|
||||||
"password": "root",
|
"password": "dasda8454456",
|
||||||
"port": "3306",
|
"port": "3306",
|
||||||
"prefix": "",
|
"prefix": "",
|
||||||
"user": "root"
|
"user": "root"
|
||||||
|
@ -20,6 +20,10 @@
|
|||||||
},
|
},
|
||||||
"注释": "可配置memory,db,redis,默认启用memory,默认优先级为memory\u003eredis\u003edb,memory与数据库缓存设置项一致,缓存数据填充会自动反方向反哺,加入memory缓存过期将自动从redis更新,但memory永远不会更新redis,如果是集群建议不要开启memory,配置即启用"
|
"注释": "可配置memory,db,redis,默认启用memory,默认优先级为memory\u003eredis\u003edb,memory与数据库缓存设置项一致,缓存数据填充会自动反方向反哺,加入memory缓存过期将自动从redis更新,但memory永远不会更新redis,如果是集群建议不要开启memory,配置即启用"
|
||||||
},
|
},
|
||||||
|
"codeConfig": {
|
||||||
|
"packageName": "默认无,必须,包名称以及应用名,生成代码的配置文件地址,比如config/app.json,数据库有更新时自动更新配置文件以及对应的生成文件",
|
||||||
|
"注释": "配置即启用,非必须,默认无"
|
||||||
|
},
|
||||||
"crossDomain": "默认空 非必须,空字符串为不开启,如果需要跨域设置,auto为智能开启所有网站允许跨域,http://www.baidu.com为指定域允许跨域",
|
"crossDomain": "默认空 非必须,空字符串为不开启,如果需要跨域设置,auto为智能开启所有网站允许跨域,http://www.baidu.com为指定域允许跨域",
|
||||||
"db": {
|
"db": {
|
||||||
"mysql": {
|
"mysql": {
|
||||||
|
Loading…
Reference in New Issue
Block a user