I have just come across a quite frankly ridiculous bug that seems to have been introduced my Microsoft in ASP.Net. Just thought I would post it here to let people know how to fix the dumb bug.
My site was redirecting to Account/Login no matter what I set as the LoginUrl in forms authentication and it was driving me mad as there was no reference at all to Account/Login in the entire solution.
After some searching I came across the following article:
It seems that the loginurl setting in forms authentication is totally useless as it is ignored. So an appsetting entry pointing to your login page is required eg <add key="loginUrl" value="~/Login.aspx" />
I did this and suddenly my site worked as expected at last!
How microsoft have not fixed this yet is anyones guess as it seems quite a major issue, also I still have no idea where it was getting the account/login reference from.
coolblue
Participant
1087 Points
502 Posts
Stupid Microsoft Bug for LoginUrl
Jun 27, 2012 10:06 AM|LINK
I have just come across a quite frankly ridiculous bug that seems to have been introduced my Microsoft in ASP.Net. Just thought I would post it here to let people know how to fix the dumb bug.
My site was redirecting to Account/Login no matter what I set as the LoginUrl in forms authentication and it was driving me mad as there was no reference at all to Account/Login in the entire solution.
After some searching I came across the following article:
http://geekswithblogs.net/WinAZ/archive/2011/08/31/formsauthentication-ignores-web.config-loginurl-settings.aspx
It seems that the loginurl setting in forms authentication is totally useless as it is ignored. So an appsetting entry pointing to your login page is required eg <add key="loginUrl" value="~/Login.aspx" />
I did this and suddenly my site worked as expected at last!
How microsoft have not fixed this yet is anyones guess as it seems quite a major issue, also I still have no idea where it was getting the account/login reference from.
BrockAllen
All-Star
27522 Points
4901 Posts
MVP
Re: Stupid Microsoft Bug for LoginUrl
Jun 27, 2012 02:44 PM|LINK
I think this is your issue.
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/