You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Chris Bailey <ch...@wego.com> on 2001/04/24 21:44:43 UTC

session id occasionally put into URL?

I am using Tomcat 3.2.1, mod_jk (w/ ajp13), Linux, Apache 1.3.19.  I
have the home page of a site mapped to a servlet, by mapping index.html
to a servlet in the web.xml file.  The problem is, I sporadically get
the session id showing up in the URL, and this results in a 404 Not
Found.

When it works "properly", I can go to the URL, "http://foo.bar.com" for
example.  Apache determines this means I want the index.html file, and
then sees this is mapped to a servlet via mod_jk, etc., and runs the
servlet, all is fine.  The browser displays either http://foo.bar.com,
or sometimes http://foo.bar.com/index.html plus any parameters, etc.

The problem case is where I see the browser shows the URL similar to
http://foo.bar.com/;jsessionid=9946qv2xml1 plus any params.  This hoses
the browser, because it tries to request the web page of
";jsessionid...", and of course fails.

Can someone explain what's going on, and how I might fix this?


-- 
Chris Bailey            chrisb@wego.com
Wego Systems            http://www.wego.com


Re: session id occasionally put into URL?

Posted by Bo Wang <bo...@home.com>.
I got this problem before, it was because of the incorrect JavaScript code
in my JSP.

Hope this help.

Becky

----- Original Message -----
From: "Chris Bailey" <ch...@wego.com>
To: <to...@jakarta.apache.org>
Sent: Tuesday, April 24, 2001 2:44 PM
Subject: session id occasionally put into URL?


> I am using Tomcat 3.2.1, mod_jk (w/ ajp13), Linux, Apache 1.3.19.  I
> have the home page of a site mapped to a servlet, by mapping index.html
> to a servlet in the web.xml file.  The problem is, I sporadically get
> the session id showing up in the URL, and this results in a 404 Not
> Found.
>
> When it works "properly", I can go to the URL, "http://foo.bar.com" for
> example.  Apache determines this means I want the index.html file, and
> then sees this is mapped to a servlet via mod_jk, etc., and runs the
> servlet, all is fine.  The browser displays either http://foo.bar.com,
> or sometimes http://foo.bar.com/index.html plus any parameters, etc.
>
> The problem case is where I see the browser shows the URL similar to
> http://foo.bar.com/;jsessionid=9946qv2xml1 plus any params.  This hoses
> the browser, because it tries to request the web page of
> ";jsessionid...", and of course fails.
>
> Can someone explain what's going on, and how I might fix this?
>
>
> --
> Chris Bailey            chrisb@wego.com
> Wego Systems            http://www.wego.com
>
>


Re: session id occasionally put into URL?

Posted by Chris Bailey <ch...@wego.com>.
On 24 Apr 2001 14:53:12 -0500, mepstein@uiuc.edu wrote:
> On 24 Apr 2001, Chris Bailey wrote:
> 
> > I am using Tomcat 3.2.1, mod_jk (w/ ajp13), Linux, Apache 1.3.19.  I
> > have the home page of a site mapped to a servlet, by mapping index.html
> > to a servlet in the web.xml file.  The problem is, I sporadically get
> > the session id showing up in the URL, and this results in a 404 Not
> > Found.
> >
> > When it works "properly", I can go to the URL, "http://foo.bar.com" for
> > example.  Apache determines this means I want the index.html file, and
> > then sees this is mapped to a servlet via mod_jk, etc., and runs the
> > servlet, all is fine.  The browser displays either http://foo.bar.com,
> > or sometimes http://foo.bar.com/index.html plus any parameters, etc.
> >
> > The problem case is where I see the browser shows the URL similar to
> > http://foo.bar.com/;jsessionid=9946qv2xml1 plus any params.  This hoses
> > the browser, because it tries to request the web page of
> > ";jsessionid...", and of course fails.
> >
> > Can someone explain what's going on, and how I might fix this?
> 
> That's URL Rewriting -- which is an alternative way (to cookies) to
> how session ids are transmitted.  I think the API calls that put that
> on the URL are encodeURL and encodeRedirectURL.  So perhaps you have
> some stray, unintended calls to those methods somewhere in your code.
> 
> Milt Epstein
> Research Programmer
> Software/Systems Development Group
> Computing and Communications Services Office (CCSO)
> University of Illinois at Urbana-Champaign (UIUC)
> mepstein@uiuc.edu
> 

I would think though, that this same problem would occur (if it is
happening in our code) under JServ?  This never happened in JServ, so it
leads me to think Tomcat is somehow involved.

-- 
Chris Bailey            chrisb@wego.com
Wego Systems            http://www.wego.com


Re: session id occasionally put into URL?

Posted by Milt Epstein <me...@uiuc.edu>.
On 24 Apr 2001, Chris Bailey wrote:

> I am using Tomcat 3.2.1, mod_jk (w/ ajp13), Linux, Apache 1.3.19.  I
> have the home page of a site mapped to a servlet, by mapping index.html
> to a servlet in the web.xml file.  The problem is, I sporadically get
> the session id showing up in the URL, and this results in a 404 Not
> Found.
>
> When it works "properly", I can go to the URL, "http://foo.bar.com" for
> example.  Apache determines this means I want the index.html file, and
> then sees this is mapped to a servlet via mod_jk, etc., and runs the
> servlet, all is fine.  The browser displays either http://foo.bar.com,
> or sometimes http://foo.bar.com/index.html plus any parameters, etc.
>
> The problem case is where I see the browser shows the URL similar to
> http://foo.bar.com/;jsessionid=9946qv2xml1 plus any params.  This hoses
> the browser, because it tries to request the web page of
> ";jsessionid...", and of course fails.
>
> Can someone explain what's going on, and how I might fix this?

That's URL Rewriting -- which is an alternative way (to cookies) to
how session ids are transmitted.  I think the API calls that put that
on the URL are encodeURL and encodeRedirectURL.  So perhaps you have
some stray, unintended calls to those methods somewhere in your code.

Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
mepstein@uiuc.edu