I use a session cookie to store an int when users first visit the system which is based on windows authentication. The cookie is set using this method
public ActionResult SetContractId(int contractId)
{
Session["LoggedContractId"] = contractId;
return RedirectToAction("IndexLoggedIn");
}
And access it in other methods using this
var creatorContractId = (int)Session["LoggedContractId"];
However this cookie times out after 20 mins and I cant seem to control this time
I have tried this in the webconfig
<system.web>
<sessionState mode="InProc" timeout="1200" />
<compilation debug="true" targetFramework="4.5.1" />
<httpRuntime targetFramework="4.5.1" />
<authentication mode="Windows" />
<customErrors mode="Off" />
<authorization>
<deny users="?" />
</authorization>
</system.web>
But it doesnt affect it