title: Strange problem with cookies in Safari and Asp.net
body: <p>I have a strange problem on my login page in Asp.net this problem only happens with Safari.</p>
  
  <p>When the user is validated I fetch the name of the user from the database (the field in the database is UTF8) and save 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 logged in. For example "Moller" works fine and the user is logged in but not "Møller".</p>
  
  <p>Again this is only happening with Safari and when I have special characters in the name. The row that isn't working is: Response.Cookies["userInfo"]["name"] = getNameFromUserid(userid);</p>
  
  <p>This is my code:</p>
  
  <pre><code>string userid = validUserWithEmail(TextBoxEmail.Text, TextBoxPassword.Text);
  if (userid != null) {
      //VALID USER
      Response.Cookies["userInfo"].Expires = DateTime.Now.AddDays(30);
      Response.Cookies["userInfo"]["name"] = getNameFromUserid(userid);
  
      FormsAuthentication.RedirectFromLoginPage(userid, CheckBoxPersistCookie.Checked);
  } 
  else
  {
      //NOT A VALID USER SHOW A MESSAGE FOR THE USER OR SOMETHING
  }
  </code></pre>