Hello All,
Using asp.net
I am trying to retrieve a cookie that is being set manually on the IIS server when the page loads. However I cannot seem to get the value. When I use firefox debugger all the cookies are showing correctly, but when I use a CookieContainer to loop through all the cookies I cannot get any results excpet from this:
24/11/2009 08:09:00 Cookie:guide.opendns.com
24/11/2009 08:09:00 Cookie:t
24/11/2009 08:09:00 Cookie:/
24/11/2009 08:09:00 Cookie:x-0
24/11/2009 08:09:00 Cookie:
My code is below (the l.wl just prints the line). Does anyone know how to retrieve the cookies?
//-------------------------------
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(" request.CookieContainer = new CookieContainer();
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
foreach (Cookie cook in response.Cookies)
{
l.wl("Cookie:" + cook.Domain);
l.wl("Cookie:" + cook.Name);
l.wl("Cookie:" + cook.Path);
l.wl("Cookie:" + cook.Value);
l.wl("Cookie:" + cook.CommentUri);
}
//-------------------------------
Thanks in advance
Using asp.net
I am trying to retrieve a cookie that is being set manually on the IIS server when the page loads. However I cannot seem to get the value. When I use firefox debugger all the cookies are showing correctly, but when I use a CookieContainer to loop through all the cookies I cannot get any results excpet from this:
24/11/2009 08:09:00 Cookie:guide.opendns.com
24/11/2009 08:09:00 Cookie:t
24/11/2009 08:09:00 Cookie:/
24/11/2009 08:09:00 Cookie:x-0
24/11/2009 08:09:00 Cookie:
My code is below (the l.wl just prints the line). Does anyone know how to retrieve the cookies?
//-------------------------------
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(" request.CookieContainer = new CookieContainer();
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
foreach (Cookie cook in response.Cookies)
{
l.wl("Cookie:" + cook.Domain);
l.wl("Cookie:" + cook.Name);
l.wl("Cookie:" + cook.Path);
l.wl("Cookie:" + cook.Value);
l.wl("Cookie:" + cook.CommentUri);
}
//-------------------------------
Thanks in advance