3
The problem: I can’t login to a site more than once on Threads
different.
My application is a Console application
.
If I open several executable, can each do successfully login in one Thread
, only the first. I believe this excludes several problems I might have related to the site I am accessing, because the various Consoles
open use the same credentials (user), are running on the same machine and are opened at the same time. Therefore the site allows more than one session on the same user.
I’m using the same solution to various websites and her worked for the most part I had to do it. The sites have no relation to each other and I do not care which technology they use(I do not think pertinent, but I can check if it is necessary).
As Threads
are initiated with new Thread(IniciaTarefa).Start(argumentos);
. The method IniciaTarefa
is static, but inside it instantiates another class that has nothing static. And it is this other class that makes the requests.
Each request is instantiated a new request = WebRequest.Create(url) as HttpWebRequest;
, despite all the requisitions of the same Thread
share the same CookieContainer
to maintain the session.
I accept any hint about what I can investigate, because I have no idea what the problem might be, I have reviewed and tried to make several changes to the code, but the problem persists.
If I have to, I can put in specific code snippets, but I don’t know what might be pertinent.
Have you checked whether there are differences in the requests for each thread using any outside programs? Like Fiddler? http://www.telerik.com/fiddler The problem is very open, it can be many things each site can manage the authentication in different ways...
– TioRAC