bugfix: Csrf token should be Secure and httpOnly, but not now

This commit is contained in:
dada0z 2022-06-18 19:50:00 +08:00
parent 8b43b87dbb
commit d696a37f48

View File

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