tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "AAron nAAs" <>
Subject Re: session across different domains ?
Date Sat, 11 Jan 2003 23:51:57 GMT
I think you will have to code specifically for Tomcat. The only way to get 
jsession encoded into your string is with Request.encodeURL or 
Request.encodeRedirectURL, but they won't do it because Tomcat will 
determine that encoding wasn't necessary, and will return your string as-is. 
"isEncodeable()" is quite strict in Tomcat.

Here is from org.apache.catalina.connector.HttpResponseBase:

     * Encode the session identifier associated with this response
     * into the specified redirect URL, if necessary.
     * @param url URL to be encoded
    public String encodeRedirectURL(String url) {

        if (isEncodeable(toAbsolute(url))) {
            HttpServletRequest hreq =
              (HttpServletRequest) request.getRequest();
            return (toEncoded(url, hreq.getSession().getId()));
        } else
            return (url);


See this which does the Tomcat servlet container's encoding:


>From: Tim Funk <>
>Reply-To: "Tomcat Users List" <>
>To: Tomcat Users List <>
>Subject: Re: session across different domains ?
>Date: Sat, 11 Jan 2003 13:15:48 -0500
>When you link to the new domain, URL encode the session id into the link. I 
>think either the servlet spec or tomcat docs should tell you you can do 
>Albrecht Berger wrote:
>>is there any way to keep the sessions when changing the domain ? I have 
>>only one webapp, but it is distributed acrosss
>>different domains.
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 

Add photos to your e-mail with MSN 8. Get 2 months FREE*.

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message