ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Redirect to login page if session get expired in ASP.Net<p>Hi <a class="username" rel="micah"> micah</a>,</p> <p>1) It seems your session Get expires. You can set Session timeout by setting in webconfig refer the below link.</p> <p><a class="title f16" href="http://www.aspforums.net/Threads/136119/What-is-the-Default-Session-TimeOut-in-ASPNet-and-from-where-I-can-change-it/">What is the Default Session TimeOut in ASP.Net and from where I can change it</a></p> <p>2) If you don&rsquo;t want to use session to maintain user name then you can use cookies or other option if you can implement.</p> <p><a href="http://www.aspsnippets.com/Articles/ASPNet-Cookies-Read-Write-Save-and-Remove-Delete-Cookies-in-ASPNet-using-C-and-VBNet.aspx">ASP.Net Cookies: Read, Write (Save) and Remove (Delete) Cookies in ASP.Net using C# and VB.Net</a></p> <p>3) But if you are using Session ["userName"] on other page and if it expire then you can check if session is null or not.</p> <p>So you can check on landing page for Session["userName"] null condition if it null redirect to login page so user can relogin if its sesson get expire.</p> <p>4) If you are using other option then also you need to maintain the value for user name like you are doing with session now for Landing Page.</p> <p>If it also expires same error will occur again and again.</p> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/197518/Redirect-to-login-page-if-session-get-expired-in-ASPNet/https://www.aspforums.net:443/Threads/197518/Redirect-to-login-page-if-session-get-expired-in-ASPNet/Mon, 16 Jan 2017 03:06:50 GMT