Incorrect forms authentication timeout

I want to make "remember time" on a site something aroun one week. In default mvc 3 application I set this changes:

<forms loginUrl="~/Account/LogOn" timeout="10880" slidingExpiration="true" />

But, it is not enought. After half an hour site forget me. What could be wrong?

Answers


Did you set propert timeout for the forms authentication ticket and also the isPersistent parameter should be set as true.

FormsAuthenticationTicket tkt = new FormsAuthenticationTicket
(
   1,                 // version
   username,          // user name
   DateTime.Now,      // issue date
   expiration,        // this should also be set to 10880
   rememberMeChecked, // this should be true
   null,              // additional data
   "/"                // cookie path
);

For more info see here.


Need Your Help

Entering new cookie to save(also understanding cookies)

c# asp.net cookies

Right now I have made a registration form. I want a user to enter their name and have it save as a cookie. When they reload the website their information will still appear. As I currently have it c...