Merge pull request #4990 from dada0z/develop

bugfix: Csrf token should be Secure and httpOnly, but not now
This commit is contained in:
Ming Deng 2022-06-18 23:19:56 +08:00 committed by GitHub
commit 7fa92f927a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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
} }