【发布时间】:2012-03-23 16:16:05
【问题描述】:
我在 jboss 的本地主机中使用服务器。服务器部署在 abc.war 中。我使用路径 eg http://localhost:8080/abc/hello.jsp 访问服务器中的文件。现在我想设置一个在 abc 内任何地方都可以访问的 cookie。如何做到这一点。
【问题讨论】:
我在 jboss 的本地主机中使用服务器。服务器部署在 abc.war 中。我使用路径 eg http://localhost:8080/abc/hello.jsp 访问服务器中的文件。现在我想设置一个在 abc 内任何地方都可以访问的 cookie。如何做到这一点。
【问题讨论】:
适当设置cookie的路径
javax.servlet.http.Cookie.setPath(String) - This cookie should be presented only with requests beginning with this URL.
【讨论】: