Two Laptop Bag*
The moose likes Servlets and the fly likes Session Time out problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Session Time out problem" Watch "Session Time out problem" New topic
Author

Session Time out problem

mridul das
Greenhorn

Joined: Jul 15, 2005
Posts: 19
When a user times out in an web app. he is directed to the login page. On successfully logging in he's directed to the page he requested beore he timed out.
We require that the user on being timed out should be taken to the home page and not the requested page. But i want to know where the server stores the original request.And how do I modify it so that I can change the URI or whatever required.
Could any one provide a solution.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30356
    
150

Mridul,
The server doesn't store the original request. You would have to write your servlet to put the request URL in the session and then redirect to the home page. Upon successful login, you can check in the session to see the original request.

So there are three states for the session:
- no session (new user)
- session with stored URL
- logged in session


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
dema rogatkin
Ranch Hand

Joined: Oct 09, 2002
Posts: 294
I have an opposite problem after relogin a user brought to a home page. How I can reach the behavior you have?


Tough in space?, <a href="http://tjws.sf.net" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="http://mediachest.sf.net" target="_blank" rel="nofollow">Check it here.</a><br /><a href="http://7bee.j2ee.us/book/Generics%20in%20JDK%201.5.html" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="http://7bee.j2ee.us/bee/index-bee.html" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="http://7bee.j2ee.us/addressbook/" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="http://searchdir.sourceforge.net/" target="_blank" rel="nofollow">How to promote your business with a search engine</a>
mridul das
Greenhorn

Joined: Jul 15, 2005
Posts: 19
>The server doesn't store the original request. You would have to write >your servlet to put the request URL in the session and then redirect to >the home page. Upon successful login, you can check in the session to see >the original request.

>So there are three states for the session:
>- no session (new user)
>- session with stored URL
>- logged in session


I cant put the URL in session becoz the server will remove everything from session upon session invalidation. So i wont get back the URL.
I need some way to determine that the user has timed out. And there's a deiiference betwee timed out and logout and opening a new browser to access the application.
Once the user times out the after loggin in the request is the same. But if he logouts or starts a browser than after loggin in he's taken to the home page. So the server has some code which decides that after security check where is the user supposed to be directed.And in all this cases a new session is created.
I want to catch that session timeout event. We are using Weblogic 8.1 SP3.
I am not sure if the SessionListener can tell me why was the session destroyed.Whether the user loggout or a session timed out happened.
 
Don't get me started about those stupid light bulbs.
 
subject: Session Time out problem