0

I have authentification for my site builded with SimpleMembershipProvider. I log in with such code:

WebSecurity.Login(model.UserName, model.Password, model.RememberMe);

RememberMe is true. And it worked fine for debugging(when I runned my site on IIS on my computer), but when I published site on the hosting I've faced log out every minute (when I try to move to action which require to be authorize - I am moved to login page).

I checked created cookie on my browser and it looks fine(it will be expired after 2 days after creation).

I use SimpleMembershipProvider as my MembershipProvider. This is how I declare it in web.config:

<membership defaultProvider="SimpleMembershipProvider">
  <providers>
    <clear />
    <add name="SimpleMembershipProvider" type="WebMatrix.WebData.SimpleMembershipProvider, WebMatrix.WebData" />
  </providers>
</membership>

<authentication mode="Forms">
  <forms loginUrl="~/Account/Login" timeout="2880" slidingExpiration="true" />
</authentication>

1 Answers1

0

The problem was restarting of IIS on my hosting. My site use too big amount of RAM, so after several calls my site's pool was automatically restarted. This is way me authentification doesn't work.