我正在尝试为 Wildfly(版本 8.2)中的网络应用程序将安全标志添加到我的 cookie 中。在 the documentation page of the servlet container settings你会发现“servlet-container”的 child 是:
- jsp
- 持久 session
- session cookie
- 网络套接字
但是我只有 jsp 和 websockets。如何访问 session cookie 设置?如果我不能,如何将安全标志添加到我的 cookie 中?
更新:我无法访问 wars 中的 web.xml 文件,只能访问 wildfly 配置文件。
最佳答案
通过 jboss-cli 尝试以下命令:
/subsystem=undertow/servlet-container=default/setting=session-cookie:add(http-only=true,secure=true)
或者在你的 standalone.xml 中:
<servlet-container name="default">
<session-cookie http-only="true" secure="true"/>
<jsp-config/>
</servlet-container>
关于java - 如何在 Wildfly 中激活安全 cookie?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31163475/