DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31482>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31482

HttpSession loses attributes if cross context is set to true

           Summary: HttpSession loses attributes if cross context is set to
                    true
           Product: Tomcat 5
           Version: 5.0.28
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Catalina
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Hallo,

I am using Tomcat 5 to run two webapplications. For both contexts I set cross 
context to true. In one webapplication I put some attributes in the session and 
use a RequestDispatcher to pass the request to the other webapplication. There 
I need to get these attributes out of the session. This worked with Tomcat 4 
but is not working any more with Tomcat 5. I looked in the source code and 
found the problem in the class org.apache.catalina.core.ApplicationHttpRequest. 
There is the function HttpSession getSession(boolean create) that overrides the 
same function of the super class. In Tomcat 4 this function was not overriden 
an thats why you got the exact same session object that you had in the other 
context. In Tomcat 5 now there is in this function getSession(boolean create) a 
new session object created (line 503) that gets only the same session id as the 
original session of the other context. That means that this session has not my 
attributes any more which I had put in the session in the other context.
For me it is unclear why this function is overriden in this way. I commented 
this function out and recompiled the class. Whith this it is working again. 
I think that should be fixed.

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

Reply via email to