Is there any way to check by javaScript whether a session is timeout? If it is possible in javascript, can any one help me with the code snippet?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If JavaScript pings the server, it will refresh the session. So it can not just call and check. It is normally done with a timer on the client that runs for a length of time. If the timer fires you know the session may be expired.
The timer would fail if the user is using multiple windows. In that case you would need to run something with localstorage/cookies to say when the last time the server was hit.