tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <wbar...@wilshire.com>
Subject Re: Is there a solution to: jsessionid is ignored in a meta refresh?
Date Tue, 03 Dec 2002 07:08:16 GMT
Try encoding the ';' as follows:

<%
  String refresh =
response.encodeURL("https://www.myserver.com/login/index.jsp");
  int jssid = refresh.indexOf(";jsessionid");
  if(jssid > 0) {
    refresh = refesh.substring(0, jssid) + "%3b" +
refresh.substring(jssid+1);
  }
%>
<META http-equiv="refresh" CONTENT="0; URL=<%= refresh %>">

"Raiden" <raiden@wonko.inow.com> wrote in message
news:Pine.LNX.4.44.0212022205490.8723-100000@wonko.inow.com...
> Hello,
>
> As is seen by searching the list archive, this problem has come up quite a
> bit, but there doesn't seem to be an agreed upon solution.
>
> The problem occurs in the following html code:
>
> <meta http-equiv="Refresh"
>
content="0;URL=https://www.myserver.com/login/index.jsp;jsessionid=3E9F55499
DCAE154870AD0FAE5B30C20?source=test">
>
> The ;jsessionid is ignored by the browser.  So, it appears that you cannot
> maintain session through URL rewriting (cookies are off), if you use a
> meta refresh.
>
> One solution that I've seen is to replace the ; with a ?, so the browser
> will accept and process the entire URL... and then intercept the browser's
> request before it gets back to the tomcat instance, and change the ? back
> to a ; (since I'm using Apache... I'd use mod_rewrite)
>
> Are there any problems with this solution?  Would a browser ever reject it
> for having two ? 's?  (one for the ;jsessionid and one for the normal
> query string)
>
> This seems like a pretty rough solution.  Does anyone have any better
> ideas?
>
> Thanks,
> Raiden





--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message