You need to first write cookie when responding first to the user request.
something like this :-
HttpCookie MyCookie = new HttpCookie("LastVisit");
DateTime now = DateTime.Now;
MyCookie.Value = now.ToString();
MyCookie.Expires = now.AddHours(1);
Response.Cookies.Add(MyCookie);
"brett" wrote:
Thanks. That worked:
string allCookie = "";
foreach(string cookie in HttpContext.Current.Request.Cookies)
allCookie += "\r\n" + cookie;
My site sets a cookie but I don't see it in the email I'm sending from
the site, which uses the above code. The only cookie I see is
ASP.NET_SessionId. I checked in IE privacy to see if the cookie had
been blocked/allowed. The site isn't listed there at all. I checked
under Tools | Internet Options | Settings | View Files for the
particular cookie. I have only five text files (cookies) listed and my
site isn't one of them.
Any ideas how I can get the cookie set on my site to see if it outputs
in the loop?
Thanks,
Brett