I'd like to set the path for a JSESSIONID cookie belonging to one of the webapps to "/" instead of "/my_webapp", as sessions are getting lost when I have to rewrite the url with mod_rewrite. I had been told that I can write a javax.servlet.Filter and a javax.servlet.http.HttpServletResponseWrapper to do this. This is working to some degree; a request comes in, and when the response.addCookie() method is called, I can change the path. In web.xml, I just have to add a <filter> element which contains the location of my java class and make sure I map it to the correct servlet.
I have one problem: the code is not being called the first time the page is requested. However, the JSESSIONID cookie is still getting added from somewhere; I'm just not sure where. This is rather curious, to say the least. What results is a cookie with a path of "/my_webapp" after the first request, and a second cookie with a path of "/" after any other request. Does anybody have any idea of why this is? I'm in desperate need of help I'd really like to change the path of the cookie on the FIRST request, not just each request thereafter. Liam Morley
lmorley@gdc.wpi.edu
"light the deep, and bring silence to the world.
light the world, and bring depth to the silence."
I have one problem: the code is not being called the first time the page is requested. However, the JSESSIONID cookie is still getting added from somewhere; I'm just not sure where. This is rather curious, to say the least. What results is a cookie with a path of "/my_webapp" after the first request, and a second cookie with a path of "/" after any other request. Does anybody have any idea of why this is? I'm in desperate need of help I'd really like to change the path of the cookie on the FIRST request, not just each request thereafter. Liam Morley
lmorley@gdc.wpi.edu
"light the deep, and bring silence to the world.
light the world, and bring depth to the silence."