0

I am programming an application that uses custom membership provider.

In my custom roleprovider web.config file I have:

<roleManager defaultProvider="ModuleProvider" enabled="true" cacheRolesInCookie="true">
  <providers>
    <clear />
    <add name="ModuleProvider" type="Website.Helpers.Security.ModuleProvider, Website" connectionStringName="CasinoEntities" />
  </providers>
</roleManager>

The problem is that when user logs off, roles cookie are not deleted, so that, when user logs again, old assigned roles are loaded. This is solved when user closes the browser and openes again, but that is not the idea.

I tried with Roles.DeleteCookie() in log off method, without success.

The log off method only contains a call to FormsAuthentication.SignOut();

Any help will he appreciated.

Regards, Jaime

jstuardo
  • 3,901
  • 14
  • 61
  • 136
  • What happens if you change to `cacheRolesInCookie="false"`? – Win Jun 13 '13 at 15:35
  • For performance reasons I want roles to be stored in cache so that database is not accessed for every request. I only need to clear that cache when user log off. – jstuardo Jun 13 '13 at 19:41

0 Answers0