想知道由 DWR
生成并发送到浏览器的 DWRSESSIONID
有何用途?它与 HTTPSession 关联吗?当使用 JSESSIONID
来维护状态时,没有看到任何创建此 cookie 的实际原因。
最佳答案
DWR 3.0 中添加了 DWRSESSIONID cookie,以防止 CSRF attacks 。它是在服务器端 DWR 类 Batch.java
首次调用时设置的。在后续调用中,BaseDwrpHandler.java
使用它来检查 CSRF 攻击。即使没有 HttpSession(因此没有 JSESSIONID),它也可用。解释者Mike Wilson on the DWR-Users mailing list :
In the DWR 3.0 model we create our own session cookie ("DWRSESSIONID") so there will always be a session cookie to base the CSRF check off, even if the application doesn't use the HttpSession.
关于cookies - DWR Cookie (DWRSESSIONID) 及其使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10574482/