I am creating webforms with asp.net. Website is working based session authority. But i have problem from session timeouts. for example when i logged in to my system after 4-5 minutes session will expire. I tried everything to make session timeout longer. Here is something ;
I changed plesk panel session timeout to 2000;
in web.config file
<sessionState timeout="120"></sessionState>
my login page
Session["user_id"] = "12313";
Session["username"] = "john doe";
Session.Timeout = 2000;
i am using these codes for control session. in my default.aspx page
if(Session["user_id"] != null)
{
Response.Write("you are logged");
}
else
{
Response.Write("Please sign in");
}
Why my session expires in 4-5 minutes?
2
Answers
The following links might help resolving the issue.
Managing Session TimeOut using Web.Config
Weird Timeouts with custom ASP.NET FormsAuthentication
you can use following code block in your web.config file.