[From] http://stackoverflow.com/questions/962729/is-it-possible-to-disable-jsessionid-in-tomcat-servlet

[From] https://fralef.me/tomcat-disable-jsessionid-in-url.html

 

Tomcat 6 (pre 6.0.30)

You can use the tuckey rewrite filter.

Example config for Tuckey filter:

<outbound-rule encodefirst="true">
  <name>Strip URL Session ID's</name>
  <from>^(.*?)(?:\;jsessionid=[^\?#]*)?(\?[^#]*)?(#.*)?$</from>
  <to>$1$2$3</to>
</outbound-rule>

Tomcat 6 (6.0.30 and onwards)

You can use disableURLRewriting in the context configuration to disable this behaviour in tomcat/conf/context.xml.

See: https://fralef.me/tomcat-disable-jsessionid-in-url.html

Tomcat 7 and Tomcat 8

From Tomcat 7 onwards you can add the following in the session config in web.xml of your application.

<session-config>
    <tracking-mode>COOKIE</tracking-mode>
</session-config>

相关文章:

  • 2022-12-23
  • 2022-01-15
  • 2022-12-23
  • 2021-04-08
  • 2022-12-23
猜你喜欢
  • 2021-09-07
  • 2022-02-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案