【问题标题】:Making JSESSIONID cookie be httpOnly in Jetty 7在 Jetty 7 中使 JSESSIONID cookie 成为 httpOnly
【发布时间】: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


    【解决方案1】:

    我所要做的就是将 jetty-web.xml 放在正确的文件夹中。最初我是放在jetty/etc 文件夹中,但它应该放在WEB-INF 目录中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-02-28
      • 1970-01-01
      • 2019-08-18
      • 2011-07-22
      • 2014-08-01
      • 2014-08-24
      • 2012-12-12
      • 1970-01-01
      相关资源
      最近更新 更多