---
title: "tomcat配置禁止url显示jsessionid"
author: "fishyych"
date: "2012-03-27T16:57:44Z"
tags: []
categories: ["Web前端"]
slug: "tomcat-url-jsessionid"
draft: false
lastmod: "2014-11-17T15:21:09Z"
id: 1465269
url: "https://fishyych.iteye.com/blog/1465269"
---

It is possible to do this in Tomcat 6.0 with: disableURLRewriting

[http://tomcat.apache.org/tomcat-6.0-doc/config/context.html](http://tomcat.apache.org/tomcat-6.0-doc/config/context.html)

e.g.

写道

&lt;  
Context docBase="PATH\_TO\_WEBAPP" path="/CONTEXT" disableURLRewriting="true"&gt;

&lt;/Context&gt;

 

 

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


Tomcat 7 supports the above config in your web-app web.xml, which disables URL-based sessions.
```

 

tomcat7还可以配置来改变jsessionid来保证服务器安全：http://tomyz0223.iteye.com/blog/811237