问题
Is there a way to find out how long the session of the user remains valid ( until it times-out)?
I would like to show this time on a page.
I know how to set the timeout, but could not find how to get the current time to time-out.
回答1:
I think you should track the time with plain JavaScript in the browser and reset with every Ajax/WebSocket call.
You cannot track it at the server because to check the time you need to make a request and this will renew the session.
回答2:
There is a getLastAccessedTime() on the session object, that might help.
来源:https://stackoverflow.com/questions/34263039/time-to-timeout-session