the browser does not send the domain name with the cookie value, so its not
in the request cookies (as its unknown). only cookies in the response
(server side) have a domain.
-- bruce (sqlwork.com)
<ul*****@gmail.com> wrote in message
news:11**********************@f6g2000cwb.googlegro ups.com...
Yes I am. I can see the name and value but not the domain. Any ideas?
private void WriteCookies()
{
HttpCookie cookie = new HttpCookie("mytest");
cookie.Domain = ".mydomain.com";
cookie.Value = "myvalue";
cookie.Expires = DateTime.Now.AddDays(1);
Response.Cookies.Add(cookie);
}
private void ReadCookies()
{
HttpCookie cookie;
for (int i= 0; i < Request.Cookies.Count; i ++ )
{
cookie = Request.Cookies[i];
if (cookie.Name == "Test")
{
Label1.Text += cookie.Name + "|" + cookie.Value+ "|" +
cookie.Domain + "|" + " ~ ";
}
}
}
Juan T. Llibre wrote:
Are you setting the domain ?
response.cookies("TEST").domain = "yourdomain.com"
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
<ul*****@gmail.com> wrote in message
news:11**********************@f6g2000cwb.googlegro ups.com...I was trying to retrieve the cookie collection and display the domain
to which those cookies were written to, but I always see a NULL value
for the domain property. Can anyone shed some light?
This is in Framework 2.0.