I am simply trying to set the expires date to one month in the future but it won't seem to work. Here is the code.
I have tried many different formats for the date but no matter what I do when checking the expires date with this:Code:Dim MyCookie As New HttpCookie("MobileLogin") MyCookie.Values("UserID") = Trim(CType(Table1.Rows(0).Cells(1).Controls(0), TextBox).Text) MyCookie.Values("LastUpdated") = Date.Now.AddDays(30).ToString MyCookie.Expires = Date.Now.AddDays(30).ToString MyCookie.Values("UserName") = Trim(datRead.Item("UserName")) MyCookie.Values("Store") = datRead.Item("Store") MyCookie.Values("AccessLevel") = datRead.Item("AccessLevel") MyCookie.Values("TempLevel") = datRead.Item("TempLevel") MyCookie.Values("TempStore") = datRead.Item("TempStore") MyCookie.Values("JobCode") = datRead.Item("JobCode") MyCookie.Values("EmployeeNum") = datRead.Item("EmployeeNum") MyCookie.Expires = DateTime.Now.AddDays(30) Response.Cookies.Add(MyCookie)
Comes back as this "#12:00:00 AM#"Code:Request.Cookies("MyMobile").Expires
Anyone know why?




Reply With Quote