can we check that if user session set into IIS, is about to expire with in some second and if it is then can we show any alert or notification to user
Asked
Active
Viewed 2,416 times
3 Answers
2
You can set session timeout to some value say 30 minutes. Use javascript code to detect user inactivity or idle time.
If the user is inactive for say 20 minutes, you can show him the popup or link to the user saying do you want to continue your session. If the user click the link his session will continue, otherwise he will be redirected to logout page.

Kapil Khandelwal
- 15,958
- 2
- 45
- 52
1
This article has very clear and good example: Alert-Session-Time-out-in-ASP-Net
there are examples of how to alert the user, redirect to home page or extend session

Y2theZ
- 10,162
- 38
- 131
- 200
0
What you cannot do is know "if session is about to expire with in some second", what you can do however is redirect the user to some page when the session has ended. Add this to your Global.asax
protected void Session_End(object sender, EventArgs e)
{
Response.Redirect("sessionend.aspx");//Youe page which greets the user the session is over
}

Ashwin Singh
- 7,197
- 4
- 36
- 55