gpt4 book ai didi

java - 如何在 Wildfly 中激活安全 cookie?

转载 作者:塔克拉玛干 更新时间:2023-11-03 04:05:50 29 4
gpt4 key购买 nike

我正在尝试为 Wildfly(版本 8.2)中的网络应用程序将安全标志添加到我的 cookie 中。在 the documentation page of the servlet container settings你会发现“servlet-container”的 child 是:

  1. jsp
  2. 持久 session
  3. session cookie
  4. 网络套接字

但是我只有 jspwebsockets。如何访问 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>

引用:http://wildscribe.github.io/Wildfly/8.2.0.Final/subsystem/undertow/servlet-container/setting/session-cookie/index.html

关于java - 如何在 Wildfly 中激活安全 cookie?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31163475/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com