2

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?

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

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.