|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
mod_rewrite URL stripping question
Hi all,
Apache : 1.3.x Tomcat : 3.x I am having a problem in that suddently, for some reason, Tomcat's session id ( jsessionid ) is getting included in the HTML URLs that are generated from the JSP code I am using. For example : http://www.domain.com/ghb/estabtype?=GH;jessionid=Gkhjfjfhgjg?type=MX The following should NOT be in the URL : ;jessionid=Gkhjfjfhgjg As a temporary workaround, how do I tell mod_rewrite to strip out the offending jsessionid and end up with the correct url ( http://www.domain.com/ghb/estabtype?=GH?type=MX ) also, does anyone know why this jsessionid should suddenly start appearing like this? I have changed nothing in the apache or tomcat configuration. Regards, Mark |
|
#2
|
||||
|
||||
|
Why is this a problem, exactly? One thing that's good about embedding sessionids in URLs is that your sessions will then work for users that disable cookies. . .
In fact, some sessioning systems will default to stuffing sessionids in the URL when it can't do it with a cookie. Are you sure cookies are working OK on the browser you're using (or that you haven't disabled them for the domain, as some browsers will let you)? I suggest you take a look at how to configure sessioning with tomcat (like you haven't already. . .) Stripping out the IDs from the URL will break a potentially valuable feature. Have you tested this from other browsers? Full disclosure- I've never installed/used tomcat and know only the basics of java. |
|
#3
|
|||
|
|||
|
Thanks for your reply. It is a problem because when the jessionid is included in the URL, it produces a 404 error when someone clicks on the link which includes the jsesionid ( see example URL in my original post ). Cookies are enabled on my browser and this has been tested on multiple browsers on multiple machines.
When you go to a part of the site that uses JSP, you will initially find that links to other JSP pages contain the jsessionid code. When you refresh the browser, the jsessionid code disappears. That is the kernel of the problem. The jsessionid code should not appear for the links to work. The question is, how do I work around this? ( mod_rewrite ? ) and also why would this happen all of a sudden after the site has been months in operation and no changes at all have been made to apache or tomcat. Regards, Mark |
|
#4
|
|||
|
|||
|
>> why would this happen all of a sudden after the site has been months in operation
"I changed a part on my car's engine, and today it does not start. What is the matter?" Sorry I know nothing about tomcat maybe you should ask the people in JSP forum, that's what that forum is for anyway. >> how do I work around this? ( mod_rewrite ? ) No. Using external redirect will send [302] and internal redirect will not work because rewrite ruleset has no way of predicting the jessionid, thus you can't hardcode it to your ruleset, therefore, mod_rewrite is not a workaround for your situation. |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > mod_rewrite URL stripping question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|