Other browsers are giving the results as expected but the problem is only with Safari. When we have a french text like Créer it does not store the value in the cookie.
Step 01
Storing the values in cookie as follow
CookieStudent.Values["FirstName"] = newApplicant.FirstName;
CookieStudent.Values["LastName"] = newApplicant.LastName;
CookieStudent.Values["Email"] = newApplicant.Email;
CookieStudent.Values["BirthDate"] = newApplicant.DateOfBirth;
Response.Cookies.Add(CookieStudent);
Step 02
Getting the stored cookie value from another controller.
if (!string.IsNullOrWhiteSpace(CookieStudent.Values["FirstName"]))
{
newApplicant.FirstName = CookieStudent.Values["FirstName"];
}
if (!string.IsNullOrWhiteSpace(CookieStudent.Values["LastName"]))
{
newApplicant.LastName = CookieStudent.Values["LastName"];
}
if (!string.IsNullOrWhiteSpace(CookieStudent.Values["Email"]))
{
newApplicant.Email = CookieStudent.Values["Email"];
}
if (!string.IsNullOrWhiteSpace(CookieStudent.Values["BirthDate"]))
{
newApplicant.DateOfBirth = CookieStudent.Values["BirthDate"];
}
Note : This solution was not working for me Server.HtmlEncode(newApplicant.FirstName); or HttpUtility.UrlEncode(newApplicant.FirstName); and then corresponding decode