开发者

MVC2 forms auth not using cookies by default?

开发者 https://www.devze.com 2023-01-10 06:58 出处:网络
I\'m building a site and doing all my tests on the built-in development server of Visual Studio. Things were working just fine but at some point my site stopped using cookies after logging in using fo

I'm building a site and doing all my tests on the built-in development server of Visual Studio. Things were working just fine but at some point my site stopped using cookies after logging in using forms. Junk was being placed in the URL string and cookies weren't being set. Session variables were being set but apparently those did not hold authentication information because once the junk was removed from the URL my app forgot who I was. This was extra annoying and difficult when my routes were redirecting and losing that junk in the URL which made me think it was a controller problem :(

I added <forms loginUrl="~/Account/LogOn" timeout="2880" path="/" cookieless="UseCookies"/> to my web.config and all is working once again.

Any idea why it changed, or better yet a definitive reason as to why it changed? I noticed that intellisense lets me set AutoDetect as well. Perhaps that is the default, but I still dont understand why things started with cookies and then moved to without. I have a few different apps running on localhost 开发者_开发问答but not concurrently. I wouldn't think that would be a problem

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号