I had this issue when I installed CS v2007 - using forms authentication and the add-on that automatically creates accounts in CS based on an email address I store in a cookie. To fix the issue, I explicitly set the cookie domain in code EVEN THOUGH it's set in the web.config file. That seemed to work.Now, after upgrading to 2008, I'm seeing many more trickling through that have the @localhost part tagged onto their email address.Any thoughts on a solution?
http://community.metalreview.com/forums
What cookie domain setting are you referring to in the web.config? Do you mean on the <forms /> line? If so, that has to do with the Forms Authentication ticket, and is not associated with email addresses at all. It is used to set the cookie domain for the browser.
With the Forms Authentication SSO module, you need to set the user's email address in the cookie information along with their log in. Please see the formsauthtest.aspx sample implementation with the download to see how it is used. Basically, you need to include an additional cookie along with the Forms Auth ticket which includes their email address. If CS doesn't get this cookie, it will failover to username@localhost to keep from dying, as CS needs an email address in order to create the user.
After I validate credentials, I do this:
FormsAuthentication.SetAuthCookie(txtUsername.Text, chkRememberMe.Checked);
MembershipUser user = Membership.GetUser(txtUsername.Text);
string strEmailAddress = user.Email;
HttpCookie cookie = Request.Cookies["CSUserEmailAddress"];
if (cookie == null)
{
cookie = new HttpCookie("CSUserEmailAddress");
}
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, txtUsername.Text, DateTime.Now, DateTime.Now.AddMonths(3), chkRememberMe.Checked, strEmailAddress);
cookie.Value = FormsAuthentication.Encrypt(ticket);
cookie.Expires = ticket.Expiration;
cookie.Path = ticket.CookiePath;
cookie.Domain = ".metalreview.com";
Copyright© 2008 Telligent Systems Inc. All rights reserved CommunityServer.com • Telligent.com