Here is my get
:
protected string Identifier
{
get
{
HttpCookie cookie = Request.Cookies[IDENTIFIER_COOKIE];
if (cookie != null)
{
return cookie.Value;
}
else
{
cookie = new HttpCookie(IDENTIFIER_COOKIE);
cookie.Value = Guid.NewGuid().ToString();
cookie.Expires = DateTime.Now.AddYears(1);
Response.Cookies.Add(cookie);
return cookie.Value;
}
}
}
When running my project locally, the cookie's expiry date is set as expected
But when I run it live, the cookie's expiry date is When the browsing session ends.
What am I doing wrong?