开发者

How to run two WebBrowser instances on the same PC with different users

I am using WebBrowser control in the WinForms application. I want to write program which can put Login and Password for some user and test some functionality. It's working fine when I am running one Application instance, but I have problem when I am trying to run two app copies with different users - both instances are wo开发者_如何学JAVArking with the same user and it's impossible to log in with different users. For example, I want to log-in to the same web site as User1 in one application and as User2 in the other app instance and perform tests.

How it's possible to implement program to allow two different app instances with WebBrowser Control to work with different users? As I understand, I have to isolate cookies somehow so different application instances will use their own sessions.


Do you understand why this is happening? You can't really "isolate the two cookies", but you could redo the app to use some sort of session key instead and POST values. It's creating a cookie using the IE settings, so it's putting the cookie in the default location.

I suppose you could override that functionality, but you would probably have to override WebBrowser.


I don't think this is an issue with your app as much as it is with how the website is functioning. Creating a cookie is a function of the browser and the website, not your client app. Do you have the ability to change the website code?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜