This is my source code. Could you tell me why the cookie value is often lost?
HttpCookie cookieUrl = new HttpCookie ("User ");
CookieUrl. HttpOnly = true;
CookieUrl. Expires = DateTime. Now. AddDays (1 );
CookieUrl. Values ["BackUrl"] = backUrl;
CookieUrl. Path = "/";
HttpContext. Current. Response. AppendCookie (cookieUrl );
Both methods have been tried, and neither of them can be normal. It starts to be normal and will not be available in a few minutes. Sometimes, as soon as the user logs on, the system immediately prompts that the user has not logged on,
HttpContext. Current. Response. Cookies ["User"]. HttpOnly = true;
HttpContext. Current. Response. Cookies ["User"]. Expires = DateTime. Now. AddDays (1); // expire in 1 day
HttpContext. Current. Response. Cookies ["User"]. Values ["BackUrl"] = backUrl;
HttpContext. Current. Response. Cookies ["User"]. Path = "/";
Please give me some tips. Thank you!