Martin,

Thanks for your reply. Your explanation of why a session id would be encoded
in the url on the first access to a page makes sense; however, it does not
explain why none of my images are being displayed. Any thoughts?

Thanks,
Whitney

-----Original Message-----
From: Martin Cooper [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 21, 2001 12:12 PM
To: [EMAIL PROTECTED]
Subject: Re: Odd URL encoding behavior


How do you know the session id in the image links is invalid? It's usually 
not an identifier that would make sense to you or me. Note that the session 
id is a path parameter in the URL, not a query parameter, so it is preceded 
by a semicolon and not a question mark or ampersand.

The reason you don't see the session id in the links after you do a refresh 
is most likely because you have cookies enabled in your browser.

When you first make a request, the servlet container doesn't know whether 
or not cookies are enabled in your browser. Therefore it encodes the 
session id in the URL as well as sending it in a cookie. On a subsequent 
request, the browser will return the cookie. Now the servlet container 
knows that it can use cookies, and so it stops adding the session id to the 
URLs as well. See the servlet spec section on Session Tracking Mechanisms 
for more detail on this.

--
Martin Cooper


At 08:22 AM 5/21/01, Whitney Hunter wrote:
>Hi all,
>
>I am experiencing strange behavior with images that I include in my page
>using the "<html:img>" tag. Here is an example:
>
>I am running my JSPs in Tomcat 3.2.1. When I bring up a page with images 
>like this for the first time, all my images are shown as invalid links. 
>When I looked at the page source, I noticed that the picture URLs all had 
>an invalid session id encoded in them: If I refresh the page, everything 
>comes up OK and there is no session id. This is obviously not acceptable 
>behavior for a customer facing system. Has anyone else experienced this 
>and is there a solution? Thanks, Whitney Hunter

Reply via email to