File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Session timeout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Session timeout" Watch "Session timeout" New topic
Author

Session timeout

kasi Raju
Greenhorn

Joined: Jun 07, 2011
Posts: 8
Hi Every one,

I am trying to use session time out to display "Welcome Back " message on my application main page.

When user accessed the application and came back to main page after 30 mints, want to display this message

Can any one help me

Thanks
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12681
    
    5
It will take more than use of a session to accomplish this, since when a session has been timed out by the container, you can no-longer get at it.

One possible way to detect that a user has recently been using your application would be a cookie. See the javax.servlet.http.Cookie JavaDocs for the methods available for creating cookies.

You could create a cookie giving the time of the last request.

Bill


Java Resources at www.wbrogden.com
Abhay Agarwal
Ranch Hand

Joined: Feb 29, 2008
Posts: 1000
    
    1

below link may help you to implement session timeout

http://www.devmanuals.com/tutorials/java/servlet/sessiontimeoutsetting.html
kasi Raju
Greenhorn

Joined: Jun 07, 2011
Posts: 8
Thank You so much for the reply.

As I am very new to java, I never worked on creating cookie

can you please give me some idea

Thank you
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12681
    
    5
Study the javax.servlet.http.Cookie JavaDocs and experiment.

A google search for "servlet cookie tutorial" finds numerous examples.

Bill
kasi Raju
Greenhorn

Joined: Jun 07, 2011
Posts: 8
Thank you Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Session timeout
 
Similar Threads
ias JSP load problem
Scope of Session Attributes
OutOfMemory with 2000 records.
Informal Survey - Use of Listeners
Handling session timeout