Click here to Skip to main content
15,887,464 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

I have created website. In these I didn't used any session but I got the session error. How can I find out session time in my website and how to set alert message if session time out message. Thanks in advanced.
Posted
Comments
F-ES Sitecore 21-Aug-15 3:18am    
Fix the code on your site so that it doesn't error when the session isn't there. There is no way of knowing when the session is going to expire, all you can really do is properly react when it does. You do this by never assuming your session variables are going to exist when you access them.

1 solution

In order to implement it you need follow below process:

Step1: Declare a javascript function which will check session is NULL.

Step2: Call that javascript function with 1 minute interval to to check session is exist? You can use setTimeout() function to call the method.

Step3: If session is null then redirect to login page or display an alert message.

Please follow below link how it can be implemented:
Alert Session Time out in ASP.NET[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900