c# - ASP.NET MVC Cookie loses value when page is changed -


When a user logs in to my site, I create a cookie with some information in it, however, whenever If they change from entering the page, then the cookie loses its value. The cookie is still there, but it is empty.

I have checked my code and the cookie has not been rewritten by anything I have made.

  public static void CreateUserCookie (long user ID, string username, Balls Meme) {HTTP Cookie cookie = new HTTP cookies ( "cookies"); Cookie.Value = string.Format ( "{0} + {1} + {2}", user ID, username, security utils. Kretehask cookie value (user ID, username)); If (Remember ME) {cookie.Expires = DateTime.Now.AddMonths (1); } And {cookie} Expiration = date time.minual; } HttpContext.Current.Response.Cookies.Add (cookie); }  

When you call this method, do you call the "meme" parameter ? If not, the cookie will expire instantly.

You have not shown your calling code, so it is possible possible by you.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -