how do i create cookies that endure forever? and how to read them? i tried the following:
and then in another page tried to load itCode:DateTime date = new DateTime(9999, 12, 20); HttpCookie userCookie = new HttpCookie("user", "xxxxxxx"); HttpCookie pwCookie = new HttpCookie("pw", "xxxxxx"); userCookie.Expires = date; pwCookie.Expires = date; Response.SetCookie(new HttpCookie("user", "xxxxxx")); Response.SetCookie(new HttpCookie("pw", "xxxxxx"));
but i get a error when a object doesnt exist..what am i doing wrong?Code:Label1.Text = Request.Cookies["user"].Value; Label2.Text = Request.Cookies["pw"].ToString();
tks




Reply With Quote