No matter what I set the asp cookie expiration time as, the browser always reports the days correctly, but the time is always 12:00:00 AM. (Wednesday, January 22, 2014 12:00:00 AM)
Here is the code I am working with:
Dim UserNameCookie As New HttpCookie("Username")
Response.Cookies.Add(UserNameCookie)
UserNameCookie.Secure = True
UserNameCookie.HttpOnly = True
UserNameCookie.Expires = DateTime.Today.AddYears(1)
UserNameCookie.Value = UserName.Text
The
DateTime.Todayproperty:Try using
DateTime.Nowinstead: