问题
I have an WindowsForms application written in C# which starts a number of threads for logging in on a site with different users' accounts. I use a WebBrowser control to navigate from the login page to the main page.
My problem is I can only authenticate with one user account, all threads are connected to the same account because the site uses cookies to store a sessionID. How can I store multiple sessions to simulate the authentication from different browsers?
Any suggestions are welcome.
回答1:
It is not possible because of existing session merging policies present in Internet Explorer - WebBrowser is the IE's emulation layer, so it abides to the same principles. A good read on the topic is available here.
To go around this issue, you will have to go further than simply using the control, but rather access IE on a lower level.
来源:https://stackoverflow.com/questions/6559223/multiple-accounts-to-a-website-application