1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-23 20:40:55 +00:00

remove flag of XSRF cookie

This commit is contained in:
Ming Deng 2020-12-12 23:24:39 +08:00
parent 9eda707297
commit aec5f4b3a5

View File

@ -149,7 +149,8 @@ func (ctx *Context) XSRFToken(key string, expire int64) string {
token, ok := ctx.GetSecureCookie(key, "_xsrf") token, ok := ctx.GetSecureCookie(key, "_xsrf")
if !ok { if !ok {
token = string(utils.RandomCreateBytes(32)) token = string(utils.RandomCreateBytes(32))
ctx.SetSecureCookie(key, "_xsrf", token, expire, "", "", true, true) // TODO make it configurable
ctx.SetSecureCookie(key, "_xsrf", token, expire, "", "")
} }
ctx._xsrfToken = token ctx._xsrfToken = token
} }