I am trying to call a web service from a C # application with sessionID.
To do this, I need to set the "Domain" header in the cookie.
In Fiddler, it looks like "ASP.NET_SessionId = izdtd4tbzczsa3nlt5ujrbf5" (the domain is not specified in the cookie).
The web service is located in the folder "http: // [some ip goes here]: 8989 / MyAPI.asmx".
I tried:
http: // [ip],
http: // [ip]: 8989,
http: // [ip]: 8989 / MyAPI.asmx
All this causes a runtime error.
I also tried only the ip address (i.e. 100.10.10.10), which does not cause a runtime error, and sets a cookie, but the cookie is never sent when I call the website method.
Here is my code for setting up the domain:
if (!string.IsNullOrEmpty(currentSessionID))
{
req.CookieContainer=new CookieContainer();
Cookie cookie = new Cookie("ASP.NET_SessionId", currentSessionID);
cookie.Domain = GetCookieUrl();
req.CookieContainer.Add(cookie);
}
?
.