Archive

Posts Tagged ‘timeout’

Redirect to login page when session timeout in ASP.NET

August 28, 2008 ppshein Leave a comment

Today, our .NET programmers face this problem, redirect to login page when session timeout in asp.net. Because we store some users’ information in session variables. And, check also users’ permission (can access only reports of his/her department) with such session variables. The problem is when session is timeout, the one can access all reports of all departments. Thus, our clients complaint these errors on and on. Today, I know how to solve this bug now. Here is, coding I put in all of master page.

if(Session["Session_name"]==null)
Response.Redirect(“Login.aspx”);