问题
i try to use a allready there PHPSESSID as a cookie. I got them freh from Firefox, so the ID is 100% correct, but the result is everytime the site for login, not the requested site.
String site = "";
WebClient client = new WebClient();
client.Headers.Add(HttpRequestHeader.Cookie, "PHPSESSID=fa90a8305a378254aefc371f875a86b2");
result = client.DownloadString(site);
what do I wrong?
回答1:
I am not familiar with WebClient or what language you are writing this in. .NET? Either way, there is always the possibility that your setting the cookie wrong, in addition to that, the PHPSESSID Is not always the ONLY form of identification for authentication and can go onto IP Address and user-agent string, etc.
I am not sure what you are attempting to do however, maybe a better explaination would help?
来源:https://stackoverflow.com/questions/17075147/phpsessid-cookie-over-webclient-doesnt-work