Re: isRequestedSessionIdFromURL() returns false

2005-06-17 Thread Michael Jouravlev
I already tried it, and it did not work. Session ID is separated by
semicolon, not by question mark or ampersand. It is treated
differently and is not shown as URL parameter.

Thanks anyway.

On 6/16/05, Jon Wingfield [EMAIL PROTECTED] wrote:
 Something like this maybe:
 
 String url = request.getRequestURL().toString();
 if (url.indexOf(jsessionid)-1
   url.indexOf(request.getRequestedSessionId())-1) {
  // do redirect
 }
 
 Jon

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



isRequestedSessionIdFromURL() returns false

2005-06-16 Thread Michael Jouravlev
Hi, I hope am I in the right mail-list with this question. I guess
that if I use Tomcat, then HttpRequest.isRequestedSessionIdFromURL()
is implemented by Tomcat.

I have a request, which contains *both* session ID in cookie *and*
session ID in the rewritten URL. isRequestedSessionIdFromCookie()
return true, but isRequestedSessionIdFromURL() returns false. It seems
that isRequestedSessionIdFromURL() should return true. Is this a bug?

I am using Tomcat 4.1.31.

Michael.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: isRequestedSessionIdFromURL() returns false

2005-06-16 Thread Christoph Kutzinski

Michael Jouravlev wrote:

Hi, I hope am I in the right mail-list with this question. I guess
that if I use Tomcat, then HttpRequest.isRequestedSessionIdFromURL()
is implemented by Tomcat.

I have a request, which contains *both* session ID in cookie *and*
session ID in the rewritten URL. isRequestedSessionIdFromCookie()
return true, but isRequestedSessionIdFromURL() returns false. It seems
that isRequestedSessionIdFromURL() should return true. Is this a bug?


Interesting question.

The Servlet 2.3 spec says:

public boolean isRequestedSessionIdFromURL()
Checks whether the requested session ID came in as part of the request URL.
Returns: true if the session ID came in as part of a URL; otherwise,
false

I would interpret it this way: if the session id, which should be used 
was extracted from the URL, then return true.
If however the cookie contains the same id and was checked first (which 
is default I think) then the requested session id came from the cookie!
Imagine what would happen if always both would be checked and URL and 
cookie would contain 2 different ids.



Christoph





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: isRequestedSessionIdFromURL() returns false

2005-06-16 Thread Michael Jouravlev
If both methods return true, they would identify the first request
after session has been established with browser which supports
cookies. I try to keep GET requests clean to encourage browser to keep
its page history from growing. When I detect this request, I perform a
redirect to the same location to clean URL up. After redirection URL
will be clean, because session ID will be contained in cookie only. I
need to do this only once.

With isRequestedSessionIdFromURL() returning false I cannot do what I
need :-( Any ideas?

Michael.

 Interesting question.
 
 The Servlet 2.3 spec says:
 
 public boolean isRequestedSessionIdFromURL()
 Checks whether the requested session ID came in as part of the request URL.
 Returns: true if the session ID came in as part of a URL; otherwise,
 false
 
 I would interpret it this way: if the session id, which should be used
 was extracted from the URL, then return true.
 If however the cookie contains the same id and was checked first (which
 is default I think) then the requested session id came from the cookie!
 Imagine what would happen if always both would be checked and URL and
 cookie would contain 2 different ids.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: isRequestedSessionIdFromURL() returns false

2005-06-16 Thread Jon Wingfield

Something like this maybe:

String url = request.getRequestURL().toString();
if (url.indexOf(jsessionid)-1
 url.indexOf(request.getRequestedSessionId())-1) {
// do redirect
}


Jon

Michael Jouravlev wrote:

If both methods return true, they would identify the first request
after session has been established with browser which supports
cookies. I try to keep GET requests clean to encourage browser to keep
its page history from growing. When I detect this request, I perform a
redirect to the same location to clean URL up. After redirection URL
will be clean, because session ID will be contained in cookie only. I
need to do this only once.

With isRequestedSessionIdFromURL() returning false I cannot do what I
need :-( Any ideas?

Michael.



Interesting question.

The Servlet 2.3 spec says:

public boolean isRequestedSessionIdFromURL()
Checks whether the requested session ID came in as part of the request URL.
Returns: true if the session ID came in as part of a URL; otherwise,
false

I would interpret it this way: if the session id, which should be used
was extracted from the URL, then return true.
If however the cookie contains the same id and was checked first (which
is default I think) then the requested session id came from the cookie!
Imagine what would happen if always both would be checked and URL and
cookie would contain 2 different ids.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]