Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session Timeout

 
Ah Ling
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all!

May I know is it possible to do a session timeout for my system in java?
My system is something to do with booking.
When the user reach last page(confirmation page) and if they never click on the ''Confirm" button, it will have session timeout and return back to the main page.
Any given example will be greatly appreciated!

Thanks!
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What has this question got to do with Swing?
 
Ah Ling
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am so sorry as i do not know where to post it.
Sorry for the incovenient caused!
Which section should this thread move to?
 
Rob Camick
Ranch Hand
Posts: 2558
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a Swing Timer. Schedule the Timer to fire in X milliseconds. If the timer fires then you cancel the session and go back to the start. If the "Confirmation" button is pressed, then you stop the Timer.

Read the section from the Swing tutorial on How to Use Timers.
 
Ah Ling
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Camick wrote:Use a Swing Timer. Schedule the Timer to fire in X milliseconds. If the timer fires then you cancel the session and go back to the start. If the "Confirmation" button is pressed, then you stop the Timer.

Read the section from the Swing tutorial on How to Use Timers.


Hey Rob Camick, Thanks for your guidance! I managed to solved it!!!
 
Rob Spoor
Sheriff
Pie
Posts: 20510
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To be honest, I don't think a Swing timer is a good solution in a non-Swing application. Since this is a web application, I would use a JavaScript timer or META refresh tag; if the page stays active for X seconds then call a new page which invalidates the session and goes to the main page. If the user does anything else (like press Confirm) the page is exited and the timer /refresh is never activated.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic