aspose file tools*
The moose likes Servlets and the fly likes IE 5.5 patch caused session.isNew() to be true always Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "IE 5.5 patch caused session.isNew() to be true always" Watch "IE 5.5 patch caused session.isNew() to be true always" New topic
Author

IE 5.5 patch caused session.isNew() to be true always

Jes Sie
Ranch Hand

Joined: Jul 24, 2001
Posts: 188
Just wanna share an experience here: -
I've done various tests and find out that the session ID is the same as they traverse across pages. But, the session.isNew() is always "true". For example: -

BigDecimal bg = new BigDecimal("123");
session.setAttribute("bg",bg);
Object obj=session.getAttribute("bg");
// test
if(session.isNew())
System.out.println("Session is new");

I've placed a similar check on its following JSP page. And it's new. This is actually not an error as the Servlet specs did say that isNew() will always return true till the browser has returned to the server.
From the JSP, I check its following Action (perform method) session....again is new! No, this is the problem. How can this be? Something is wrong, huh?
The interesting thing is why it used to work? What's the diff between today and the last time? Ahhhh...I've updated my IE 5.5 to run the latest patch from Microsoft.
Therefore, I've to download another browser to test. I used mozilla.org. True enough....it works. This proof that Struts and your component is clean and only IE patch sucks.
I think you should put this mail as one of your support knowledge base.

Gee...this is annoying. I hate Microsoft!!!


Thank you.<br /> <br />- Jess Sie<br /> <a href="mailto:jess@see-consulting.com" rel="nofollow">jess@see-consulting.com</a>
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

Couple questions:
1- Are you sure you have cookies turned ON in IE 5.5? -- You won't be able to maintain session without any cookies.
2- So on each page you get session.isNew() == true -- but can you store on object in session on page1.jsp and retrieve the object in page2.jsp? or has the object disappeared?


- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: IE 5.5 patch caused session.isNew() to be true always