aspose file tools*
The moose likes Servlets and the fly likes Session is lost in new browser window. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Session is lost in new browser window." Watch "Session is lost in new browser window." New topic
Author

Session is lost in new browser window.

K West
Ranch Hand

Joined: Sep 10, 2008
Posts: 58

I am using Servlet filter to secure help documents in the site.
If the session is expired or user enters the document URL directly into browser, it redirects user to log in page.

Web.xml



Filter Servlet : DocumentAuthenticationFilter




This works great in all browsers. If session is expired user is redirected to log in page else document is opened in the new window of browser.

But in IE 8 the session is not found in the newly opened browser window and the filter redirects the user to log in page, as well as session in the parent page is also lost after that.

Has anyone come across this? Any suggestions?

Thank you.
Mike Zal
Ranch Hand

Joined: May 04, 2011
Posts: 144

Previous Discussion on the topic

What do you mean by newly opened window? Is that a new window that was opened by your website or do you mean when the user enters opens another window themselves?

You shouldn't need a filter to control access to your documents. You should be able to use Declarative Security.


OCJP6, OCWCD5
K West
Ranch Hand

Joined: Sep 10, 2008
Posts: 58

Yes, its the new window that was opened by the website upon clicking the link of document.

You should be able to use Declarative Security.


I don't want it to be role based. Only requirement is that the user should be logged in to view the document.

Thank you.
 
Consider Paul's rocket mass heater.
 
subject: Session is lost in new browser window.