Tuesday, August 18, 2015

FedAuth Cookies ARE Case-Sensitive!!

I was recently working with Windows Identity Foundation and FedAuth Cookies when I noticed that my application kept on losing my FedAuth Cookie information!

Well, after doing some debugging and troubleshooting with Microsoft, I was able to find this line in my RouteConfig.cs file:

routes.LowercaseUrls = true;

Well, as it turns out, this line was causing my Urls to switch context from /MyUrl to /myurl.  Since my FedAuth Cookies were being created at the time of login, when the Url in my application changes, I suddenly lost my FedAuth Cookies!

Well, once I determined that this behavior was occurring, I decided that I needed to change that code to this instead:

routes.LowercaseUrls =false;

Now my application retained my Url all the way through the application and I no longer lost my FedAuth Cookie information!!

No comments:

Post a Comment