ASP.NET Authorize Attribute Not Working

1.5k Views Asked by At

I've removed the Identity authorisation from a MVC 5 app and started using Brock Allen's Membership Reboot but for some reason I can now access actions with the 'Authorize' attribute even when I haven't signed in? Can someone please tell me what I may have missed out or haven't done? Thanks!

2

There are 2 best solutions below

0
Brock Allen On

Either your authentication cookie is not being issued or the cookie is not being processed. Check to see if the username is there (or if IsAuthenticated is true).

0
Rhs On

It looks like you are not expiring your forms authentication cookie.

Try clearing your browser of cookies and try hitting a page with the [Authorize] attribute.