i am using asp.net and sql server for my web application.
my files are published in a shared windows hosting server,the default session length overridden by web hosting service 5 mins.
for that i decide to use cookie instead of session.
now the problem is...if i use a page after 3 mins its going to the custom error page named "sessionexpire.html".....i can not understand the problem...actually what is going on...please help me....
What I have tried:
private void CheckCookie()
{
HttpCookie CookieName = Request.Cookies["MyCookie"];
CookieName.Expires = DateTime.Now.AddMinutes(30);
if (CookieName != null)
{
Uid = Request.Cookies["MyCookie"]["UserId"];
UTyp = Request.Cookies["MyCookie"]["UserType"];
UName = Request.Cookies["MyCookie"]["name"];
ArrangerId = Request.Cookies["MyCookie"]["ArrangerId"];
}
}
protected void Page_Load(object sender, EventArgs e)
{
try
{
CheckCookie();
}
catch (Exception ex)
{
string s = ex.Message;
Response.Redirect("logout");
}
}
and in web config i have written
sessionState mode="InProc" timeout="30"
compilation debug="true" and targetFramework="4.0"
customErrors mode="On"
defaultRedirect="sessionexpire.html"
authentication mode="Forms"
and forms timeout="30"