Juriy
Juriy

Reputation: 5111

Tomcat 7 session cookie path

I'm having a huge problem with my application and Tomcat 7. My application needs to set session cookie to "/" path instead of "/context" path. In tomcat 6 it was a matter of adding another property to Connector (emptySessionPath="true") and Tomcat 7 doesn't recognize this thing. I know that Servlet 3.0 spec allows to configure it on per-context basis, but I couldn't make it work with Tomcat 7. It still adds the context path instead of "/".

I will be very grateful for the receipt on how to do it.

Upvotes: 24

Views: 31939

Answers (1)

Vadym
Vadym

Reputation: 5284

Juts put the sessionCookiePath="/" attribute into your context.xml root node:

<Context ... sessionCookiePath="/" > ... </Context>

Upvotes: 40

Related Questions