• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session timeout

 
kasi Raju
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
Abhay Agarwal
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
below link may help you to implement session timeout

http://www.devmanuals.com/tutorials/java/servlet/sessiontimeoutsetting.html
 
kasi Raju
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Study the javax.servlet.http.Cookie JavaDocs and experiment.

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

Bill
 
kasi Raju
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic