jsessionid 如何删除
1. 如果你是 Tomcat 6的话, 'disableURLRewriting' attribute 设置为 true
找到你tomcat的 context.xml 文件
1 2 3 |
|
下面是 Attribute disableURLRewriting 官方说明
Set to true to disable support for using URL rewriting to track session IDs for clients of this Context. URL rewriting is an optional component of the servlet 2.5 specification but disabling URL rewriting will result in non-compliant behaviour since the specification requires that there must be a way to retain sessions if the client doesn't allow session cookies. If not specified, the specification compliant default value of false will be used.
2. 如果你是 Tomcat 7+
The Servlet 3.0 standard gives you two ways to disable URL session rewriting.
第一种途径你可以修改 web.xml :
1 2 3 |
|
或者你在代码里面使用
1 |
|