Forums Register Login

Session Timeout

+Pie Number of slices to send: Send
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!
+Pie Number of slices to send: Send
What has this question got to do with Swing?
+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
 

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!!!
+Pie Number of slices to send: Send
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.
Don't play dumb with me! But you can try this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1861 times.
Similar Threads
My First Struts App
EJB Transaction Handling Question
Preventing the submission of a jsp/html page on users relogging in after timeout
Releasing HTTP session state
JSF equivalents of process pages
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 13:16:14.