I have two different mvc3 projects.
The strange thing now when i log into either one of my web, the other one auto logged in use the same account name.
FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
It is very strange to me. can someone explain it and how should i prevent it?
FormsAuthentication works through Cookies, and browser does not allow shared cookie between different domain. but allow to share between same domains.
so this is happening when you are running at your localhost.
to avoid such situation just change the cookie name in your web.config file.
if you do not provide a cookie name, it will take a default name, to provide cookie name manually in your web.config, search Authentication Element and replace its block with
here .yourCustomCookieName is your cookie name.