Remove jsessionid from URL

Cijo picture Cijo · Jul 4, 2012 · Viewed 41k times · Source

I'm working on a project with the following technologies:

  • Spring
  • ShiroFilter
  • PrettyFaces
  • Tomcat server

While I'm deploying it on tomcat server, I'm getting a "JSESSIONID 456jghd787aa" added at the end of the URL.

I was trying to resolve this but I'm not able to do that.

Answer

NimChimpsky picture NimChimpsky · Jul 4, 2012

For tomcat 7 add this to web.xml

<session-config>
  <!-- Disables URL-based sessions (no more 'jsessionid' in the URL using Tomcat) -->
  <tracking-mode>COOKIE</tracking-mode>
</session-config>