Django Book 翻译
菜单>:
TOC
返回
原文:
1. It modifies outgoing requests by adding a hidden form field to all ``POST`` forms, with the name ``csrfmiddlewaretoken`` and a value that is a hash of the session ID plus a secret key. The middleware does *not* modify the response if theres no session ID set, so the performance penalty is negligible for requests that dont use sessions.
翻译:
1. 它修改当前处理的请求,向所有的 ``POST`` 表单增添一个隐藏的表单字段,使用名称是 ``csrfmiddlewaretoken`` ,值为当前会话 ID 加上一个密钥的散列值。如果未设置会话 ID ,该中间件将 *不会* 修改响应结果,因此对于未使用会话的请求来说性能损失是可以忽略的。
备注:
译者: