java - When to expect getLastAccessedTime() to be updated in HttpSession -


according documentation, getlastaccessedtime() updated every time request made within life of session.

my application has heartbeat servlet called every minute after user logs system , starts important scan process. when user logs in, session created , on heartbeat called periodically(every minute). logically should mean lastaccessedtime updated every minute. assumption correct?

next, have session timeout settings of 15mins. if user has been inactive 15 mins (when not running scan), session destroyed , caught in httpsessionlistener's sessiondestroyed method. therefore lastaccessedtime should show session last accessed precisely 15mins ago. time not show when user logs out himself.

to make clear, safe use lastaccessedtime find when user last active in session. also, safe assume time 15mins when session destroyed due inactivity?

yes, getlastaccessedtime() updated whenever request comes cookie associated session. assumption correct lastaccessedtime updated every minute.

so, if sending hearbeats technically session active.

coming session timeout value. yes, safe assume session destroyed 15 mins of inactivity. but, never case.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -