1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-12 12:50:40 +00:00

Merge remote-tracking branch 'origin/develop' into ftr/middleware

This commit is contained in:
Ming Deng
2020-08-04 07:27:45 +00:00
9 changed files with 36 additions and 21 deletions

View File

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