我正在寻找一个类似于此的解决方案:httpOnly Session Cookie + Servlet 3.0 (e.g. Glassfish v3)
我想关闭HTTP头:仅http和安全关闭,以便使用https的身份验证传递到http请求。
然而,1个员额涉及另一个员额。我不使用Servlet3.0。如果有合适的文档说明如何将intellij项目从serverl2.5迁移到3.0,我可能会尝试使用Servlet3.0。如何使用这个似乎不太明显。将我的maven pom更改为javax.servlet 3.0,然后将我的web.xml版本编辑为3.0,这是行不通的。在3.0版本上给出了一个面错误。叹一口气。
domain.xml
<web-container>
<session-config>
<session-manager>
<manager-properties></manager-properties>
<store-properties></store-properties>
</session-manager>
<session-properties>
<property name="cookieSecure" value="false"></property>
<property name="cookieHttpOnly" value="false"></property>
</session-properties>
</session-config>
</web-container>……
<configs>
<config name="server-config">
<http-service sso-enabled="true">
<access-log></access-log>
<virtual-server id="server" sso-cookie-secure="false" sso-cookie-http-only="false" network-listeners="http-listener-1,http-listener-2"></virtual-server>
<virtual-server id="__asadmin" sso-cookie-http-only="false" network-listeners="admin-listener"></virtual-server>
</http-service> default-web.xml
<session-config>
<session-timeout>60</session-timeout>
<cookie-config>
<http-only>false</http-only>
<secure>false</secure>
</cookie-config>
<cookie-properties>
<property name="cookieSecure" value="false" />
<property name="cookieHttpOnly" value="false" />
</cookie-properties>
<tracking-mode>COOKIE</tracking-mode>
</session-config>发布于 2012-01-15 19:14:36
好吧,我觉得有点蠢,但是我以前从来没有写过一个特定的容器,以确保我的代码可以跨容器移植。但是,经过一些研究后,我发现您可以将类似于此的setting / glassfish -web.xml文件放在glassfish下面的每个WAR文件中来控制您的安全cookie设置。
http://blogs.oracle.com/jluehe/entry/ow_to_configure_the_security
<?xml version="1.0" encoding="UTF-8"?>
<glassfish-web-app>
<session-config>
<cookie-properties>
<b><property name="cookieSecure" value="[true|false|dynamic]"/></b>
</cookie-properties>
</session-config>
</glassfish-web-app>https://stackoverflow.com/questions/8706125
复制相似问题