My application is throwing an error when the session expires.
I dont want the sessions to expire automatically....
but if there is no way to do that then instead of showing the error it should be redirected to the login page...
I tried to do this....
Response.AppendHeader("Refresh", Convert.ToString((Session.Timeout * 60) + 10) + "; URL=Login.aspx");
this code not working when session expires.. i get an error message
Response is not available in this context.
the web config has this
<authentication mode="Forms">
<forms loginUrl="Login.aspx" name="Cookie" timeout="10080" path="/">
</forms>
</authentication>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
Is there anything else i need to add in the web config...
any suggestions... thanks
this is my page load
protected void Page_Load(object sender, EventArgs e)
{
Response.AppendHeader("Refresh", Convert.ToString((Session.Timeout * 60) + 10) + "; URL=Login.aspx");
string userName = Session["userName"].ToString();
string password = Session["password"].ToString();
string domain = Session["domain"].ToString();
impersonateValidUser(userName, domain, password);
}