【发布时间】:2012-10-09 17:05:15
【问题描述】:
我们正在运行 grails 2.0 + jetty 7.6.6,需要将 JSESSIONID cookie 设置为 httpOnly。 stackoverflow 上的所有答案似乎都指向 Servlet 3.0(需要码头 8)或 tomcat。 谁能为我提供一个明确的方法,将 JSESSIONID cookie 设置为 httpOnly for jetty 7.x?
我已经尝试添加 jetty-web.xml 文件,内容如下,但它仍然不起作用(即 JSESSIONID 未标记为 httpOnly):
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Get name="sessionHandler">
<Get name="sessionManager">
<Set name="httpOnly" type="boolean">true</Set>
</Get>
</Get>
</Configure>
【问题讨论】:
标签: grails jetty session-cookies jsessionid httponly