views:

53

answers:

1

On session timeout we re-direct to the login page and if the user logs back into the portal he gets re-directed to the page he was trying to navigate in the first place.

In our case, the re-directed page tries to fetch values from the session and it fails badly with exceptions and it works just fine when there is no dependency on pages which don't have any dependency on session variables.

What is the best way to handle the situation? Can we just redirect this to the home page instead, if so how to do this?

+1  A: 

It depends on how much information you are storing in the session, as a guideline, you should always the "shortest" scope ever.

Probably your best option is to allow redirect only on stateless pages, so that it won't give you any problem about inconsistent state.

As for your last problem, take a look at this: redirecting-on-session-timeout-in-jsf-richfaces-facelet. Just set the tag to whatever you want.

volothamp