Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem: immediate session timeout  RSS feed

 
J Lafs
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have set the session timeout in web.xml to 60 but when I start on the home page and begin to enter any data I immediately get redirected to the timeout page.
From the timeout page I can click a link that takes me to the home page. Now I get the 60 minutes before another timeout occurs. Changing the timeout only results in a change to the timeout after going back to the home page

Any ideas on why I am seeing an immediate timeout?

Deploying to Glassfish v3.1, using Primefaces 3.4.1, JSF 2.1.14
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, J Lafs!

I'm not quite sure what's going on here, or even if JSF is involved. For one thing, there isn't any such thing as a "session timeout page" in JEE/J2EE. The closest you'd get is that if you're using standard container security and requesting a secured page after the timeout interval, you'd be presented with the login page. Otherwise the session is simply destroyed, and, if required a new session would be constructed.

One thing that can cause problems in JSF is that the "welcome page" may not function properly when done as a JSF page, since, as a web.xml-defined resource, access to the page may not be done via the standard URL mechanism (this is also true of login pages and error pages). For that reason, when I have a JSF welcome page, I create a stock "index.jsp" that does a forward to the actual JSF URL of my home page.

 
J Lafs
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Figured it out. I am using Ajax for a few of the controls on the page. I am also using pretty faces and have set up site so that the welcome page is start.jsp which redirects to the home page.
However, instead of starting on the welcome page, and being redirected to the home page, I was going directly to the home page.
I am pretty sure this was causing me to start with an invalid view state which then caused the session expired to occur.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!