i need pass the cookie values to another Url which have same domain.i have two url's with same domain name..one Url for Authentication another is for retrieve data.i executed first url its authenticated . with this authentication cookie i want to execute second url ..
How to do this...i unable to Add cookie to socond url
here is my code..
string url = "http://172.16.xx.xxx:8080/cms?login&username=santhu&password=welcome"; string url1 = "http://172.16.xx.xxx:8080//cms?status=ProcessStatus"; string result = null;
try
{
WebClient client = new WebClient();
WebClient client1 = new WebClient();
result = client.DownloadString(url);
TextBox1.Text = result.ToString();
if (Response.Cookies["JSESSIONID"] != null)
TextBox1.Text = Server.HtmlEncode(Response.Cookies["JSESSIONID"].Value);
client1.Headers.Add("JSESSIONID", TextBox1.Text);
result = client1.DownloadString(url1);
TextBox2.Text = result.ToString();
}
catch (Exception ex)
{
}