Pra*_*ash 5 java servlets jsessionid google-cloud-datastore
我已经使用 Google Datastore 在 servlet 中创建了一个登录页面,它工作正常。但有时它会在 URL 中显示 JSESSIONID。
如何阻止 JSESSIONID 通过 URL 发送?为什么它通过 URL 而不是请求消息传递?
在您的web.xml.
<session-config>
<tracking-mode>COOKIE</tracking-mode>
</session-config>
Run Code Online (Sandbox Code Playgroud)
这将指示容器客户端支持 cookie,因此无需将 cookie 放入JSessionIdURL 中。
你正在用response.encodeURL()吗 ?如果是这样,请尝试将其删除或禁用“URL 重写”并检查 URL。
也可以看看:
附加信息:
response.encodeURL(URL)添加;jsessionid=xxxx...到网址。要禁用此功能(=“URL 重写”),
Tomcat 7.0 或更高版本:
<session-config>
<tracking-mode>COOKIE</tracking-mode>
</session-config>
Run Code Online (Sandbox Code Playgroud)
汤姆猫6.0:
<Context disableURLRewriting="true" ...
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
15418 次 |
| 最近记录: |