I'm using forms authentication on my mvc project, and it seems that no matter what I do. You can only stay logged in for one day then it requires you to log in again.
In my web.config, I set the timeout to a week in minutes.
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" timeout="10080" defaultUrl="/kpi" slidingExpiration="true" />
</authentication>
And here is where I'm setting the cookie.
var cookie = FormsAuthentication.GetAuthCookie(account.UserName, account.RememberMe);
if (account.RememberMe)
cookie.Expires = DateTime.Now.AddDays(7);
Response.Cookies.Add(cookie);
var returnURL = FormsAuthentication.GetRedirectUrl(account.UserName, account.RememberMe);
var hashData = Request.Form["HashHidden"];