Forms Authentication in IE

cindysand

New Member
I have seem a few of these asking the same question but none of the solutions have worked for me thus far so I wanted to see if I am doing something wrong. I have a site that I am using asp.net MVC to create, at current I am using forms authentication to prevent anonymous users from browsing the site. That bit of code is as follows.\[code\]<authentication mode="Forms" > <forms loginUrl="~/login" timeout="15"/></authentication>\[/code\]Then I have a login controller that has the user enter their userName and password then creates an authcookie if the information is accurate. \[code\]if (password == encryptedPassword){ FormsAuthentication.SetAuthCookie("user", true, model.userName);}\[/code\]All of this works in Firefox and Chrome and after the user has logged in he is able to browse the site. However in IE it keeps returning to the log in screen because it keeps recognizing the user as an anonymous user. I checked and the Auth cookie is either never created or doesn't persist as soon as you enter the next page. Some of my attempts to fix this involved using cookieless in the web.config. The only one that works was the one that actually puts the cookie in the URI and we can't have that for the site. Then I tried setting ticketCompatibilityMode="Framework40" but there was no luck there either. I did see a bug with domain names having non-alpha numerica characters. I currently use the IP to access the domain directly, so I don't know if periods run this problem but even my local host suffers from the same issues. Any input would be appreciated.
 
Back
Top