Click here to Skip to main content
15,887,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a custom RoleProvider and I want to remove the role cache on logout. The roles I have are "Administrator" and "Member", which are working accordingly to authorize every page/action I have in my application but when I try to change the role of the user within the same opened browser it's not updating. Here's the scenario:

.. I sign in as user "User1" with "Administrator" role and browse administrator pages and logs him out.
.. I sign in as user "Admin" with Administrator role and change User1's role to "Member" role. I checked the database and his RoleID has been changed. I log the "Admin" out.
.. I sign in back "User1" and browse the application. I can still browse administrator pages even though this user has already a "Member" role. I log him out.
.. I close the browser and open the application in a new browser. I sign in as user "User1" and browse the application. I can only browse member pages now.

How can I remove the cache of the role on browser on sign out/logoff?
Posted

1 solution

Just resolved my problem.. I added Application_OnPostAuthenticateRequest on Global.asax.cs and assigned a new GenericPrincipal to HttpContext.Current.User. :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900