locked
Windows Forms with 2 web browser controls with different sessions RRS feed

  • Question

  • We have a website where we automate user input using a browser control within the application.  We are now needing to add a second browser control to access the same web page at the same time to input seperate set of data.  The issue is when you are logged in as one user in one browser it has that same user logged in on the other browser control.  Probably a simple solution but is there a way to keep these two browsers in seperate sessions so different users can be logged into the same site at one time or is this just not possible?  Any help is appreciated..

    Michael Duhon

    Tuesday, September 27, 2016 11:32 PM

Answers

  • Hi Michael,

    >> The issue is when you are logged in as one user in one browser it has that same user logged in on the other browser control.

    Web Browser control is IE built-in browser controls, IE would save the account in cookies when one account log in a login page , and IE would automatic log in when open the login page again, IE would only save a cookies for one user, so two page would log in at the same time and log out at the same time for one account.

    Best Regards,


    Wednesday, September 28, 2016 3:41 AM
  • According to documentation, some of the aspects can be configured using -noframemerging and -nosessionmerging command line options and registry settings: https://msdn.microsoft.com/en-us/library/hh826025%28v=vs.85%29.aspx. Check if these registry values help in case of WebBrowser.

    Otherwise, maybe consider a different approach: instead of inserting the second WebBroser, launch your current program under a different Windows user, specially created for your automation purposes. This can be done with “runas” command-line utility.


    Wednesday, September 28, 2016 6:59 AM

All replies

  • Hi Michael,

    >> The issue is when you are logged in as one user in one browser it has that same user logged in on the other browser control.

    Web Browser control is IE built-in browser controls, IE would save the account in cookies when one account log in a login page , and IE would automatic log in when open the login page again, IE would only save a cookies for one user, so two page would log in at the same time and log out at the same time for one account.

    Best Regards,


    Wednesday, September 28, 2016 3:41 AM
  • According to documentation, some of the aspects can be configured using -noframemerging and -nosessionmerging command line options and registry settings: https://msdn.microsoft.com/en-us/library/hh826025%28v=vs.85%29.aspx. Check if these registry values help in case of WebBrowser.

    Otherwise, maybe consider a different approach: instead of inserting the second WebBroser, launch your current program under a different Windows user, specially created for your automation purposes. This can be done with “runas” command-line utility.


    Wednesday, September 28, 2016 6:59 AM