1

I have read some issues related to session time out and i have changed the settings but no avail.

This is entry of session in web.config. i want to expire the session after 5 hours.

<sessionState mode="InProc" timeout="300" />

On Login page i am adding user name in session

Session.Add("Authenticated", UserName);

and my each page is inherited with BasePage and in base class i have this check for each page.

if (Session["Authenticated"] == null)
{
   Response.Redirect("../userlogin.aspx");
}

but session expires before one hour.

I want to confirm that during this there is no change in web.config, Bin folder files etc.

2 Answers 2

2

Take a look at this ASP.NET Session Timeouts.

Besides IIS Idle timeout there is Forms authentication timeout, which is 30 min by default. So you will be redirected to the login page before the session actually expired.

<system.web>
    <authentication mode="Forms">
         <forms timeout="300"/>
    </authentication>

    <sessionState timeout="300"  />
</system.web>
Sign up to request clarification or add additional context in comments.

Comments

0

If you are hosting it on IIS6 (Win2K3) then go to the settings in the Application Pool in which your application runs. You need to set it there as well.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.