1

I'm working on an application that requires multiple embedded instances and each of this instance logins to the same external site with different authentication details.

Initially I went with C#.Net but soon realized that webbrowser control shares cookies and there's no way to bypass this. I've read about INTERNET_OPTION_END_BROWSER_SESSION but it ends session process wide (I need different sessions within the same process ) and is therefore of not much help.

The other alternatives available are embedded webkit (QT4) and firefox. Does anybody have any experience of working with these in a similar use case? Webkit docs do mention a separate QCookieJar - would that mean isolated sessions ?

Any insight or help would be greatly appreciated.

Thanks

Clifford
  • 88,407
  • 13
  • 85
  • 165
Code freak
  • 695
  • 2
  • 8
  • 19
  • 1
    Before looking for such a tool, won't you think again about your problem ? This seems rather unconventional to me to simultaneously login with several different credentials. The problem may be solved with a different architecture. Can you develop on what you are trying to do ? – Offirmo Jan 03 '12 at 18:11
  • I'll elaborate a bit using GMail as an example site - I need 4 ui panels in 1 window and in each panel, I need to open the gmail page as a different user. IE has a nomerge option for the same purpose. These cannot be separate process as that'll be against the client requirements. – Code freak Jan 03 '12 at 18:21
  • no comment/answer ?? is my description poor or the solution impossible ? – Code freak Jan 04 '12 at 00:59
  • 1
    I have read your question again and I find it understandable and pertinent (I deleted my previous comment stating that it was not clear). I think nobody answer because your problem is difficult and not very common (no answers on google too). I think the ideas you give at the end are good. Experiment with them, then answer your own question so other people will benefit. – Offirmo Jan 04 '12 at 11:06

2 Answers2

2

Achieved using WebKit. I tried PyQt4.QtWebkit but should work for gtk webkit as well.

Code freak
  • 695
  • 2
  • 8
  • 19
  • 1
    Thanks for taking time to share your findings. – Offirmo Jan 07 '12 at 16:57
  • I'm facing same problem and no help on internet. Can you show a sample? Did you use WebKit.NET? Thanks – Marco Nov 08 '12 at 10:20
  • No. I used PyQt4.QtWebkit. Don't have a sample but its fairly easy, you just need to replace the default cookiejar for the webview with a custom implementation. That should solve the problem. – Code freak Nov 09 '12 at 15:15
0

I don't know exactly how to do this, but looking for "c# .net web browser session" in google, I found thoses links that lead me to believe it's possible :

Most people are trying to get the oposite of what you want, meaning that they are in the state you want.

Community
  • 1
  • 1
Offirmo
  • 18,962
  • 12
  • 76
  • 97
  • Thanks for the reply. The issue described in the 2 links isn't the same. They are facing the problem of "losing the session". What I need is unshared sessions within the same process I'm not sure if the 2 issues are related. However, I'll be trying webkit soon and post the answer if it works. – Code freak Jan 04 '12 at 17:28