Contdown on Servlet Session
Asked Answered
B

1

6

I need to create a countdown on the servlet´s session to fire events when X minutes to expire...

So, there is a way to know how many seconds is remaining to finish the session?

Biometry answered 20/3, 2013 at 21:3 Comment(0)
B
9

You can compute the remaining time (in seconds) using the HttpSession API:

httpSession.getMaxInactiveInterval() - ((System.currentTimeMillis() - httpSession.getLastAccessedTime())/1000
Baun answered 20/3, 2013 at 21:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.