I have a strange problem on my Asp.net login page, this problem only occurs with Safari.
When the user is verified, I select the username from the database (the field in the database is UTF8) and stores it in a cookie. The problem is that when the user has a name with special characters, I get redirected to the page where I came from without being registered. For example, the “Moller” works fine, and the user is logged in, but not the “Møller".
Again this only happens with Safari and when I have special characters in the name. String that does not work: Response.Cookies ["userInfo"] ["name"] = getNameFromUserid (userid);
This is my code:
string userid = validUserWithEmail(TextBoxEmail.Text, TextBoxPassword.Text);
if (userid != null) {
Response.Cookies["userInfo"].Expires = DateTime.Now.AddDays(30);
Response.Cookies["userInfo"]["name"] = getNameFromUserid(userid);
FormsAuthentication.RedirectFromLoginPage(userid, CheckBoxPersistCookie.Checked);
}
else
{
}