Multi-Session Browsing in One Window/Tab

I’ve been given a project as my final deliverable for my degree (working with another dev) and am having some real trouble figuring out how to do it. Now firstly I need to avoid too much disclosure of the idea because the IP belongs to the uni, so I’ll ask the questions regarding the tech and not the description of the application.

I need to make a web application that can support multiple logins to other websites. That is to say, you log in to my site, and are presented with multiple embedded browser windows with which you can log in to multiple other websites and see the changes live in each. Essentially, multiple browser windows in one tab, with a UI managed by our site. If it helps, imagine logging in to facebook as two different people and sending a PM between each other, the messages need to be seen live in both windows.

The obvious difficulty we’re having with it is the concept of multiple sessions in one. Furthermore, once we manage to sort that out, we’re yet to figure out how to actually embed such a thing into a web page.

We’ve experimented with a few technologies, but have come up a little empty.

Our first thought was to use some kind of custom serving technology like NodeJS and figure out how to allow for multiple sessions, but either due to lack of documentation, similar projects or just lack of experience on our behalf, that wasn’t fruitful.

Our next thought was to use a browser extension in combination with a website and essentially use the extension to modify the browser and allow for multiple sessions. Again, as far as we can find, that idea doesn’t really seem possible either.

Another idea we’ve been playing with is using something called Awesomium, which is an open-source variant of Chromium Embedded Framework. Awesomium seems to be really quite good, and it’s supported for C++ and .NET. I managed to make a desktop application prototype that worked quite well with multiple sessions, but unfortunately it seems like Awesomium isn’t made to work with ASP.NET, because really why would somebody want such a thing :p. We were also considering attempting to use CEF ourselves but to be quite honest I didn’t even know where to start with that and got nowhere.

The final idea we’ve been playing with is trying to do something like a proxy site does, again somehow using multiple in one browser. This was kind of the other side of things where we were considering a hardware or networking based approach instead of software based.

I would love any kind of advice anyone can give, or even just some ideas or thoughts to discuss. Thanks in advance!

The problem as you have defined it is essentially impossible.

The reason is that session information is (necessarily) kept by the browser, and it is keyed on the browser's knowledge of the identity (domain) of the site it is communicating with. In order to have multiple sessions in a single page, you would have to create a proxy which makes it look to the browser as if the site has multiple different names (like facebook-1.example.com and facebook-2.example.com, and this is problematic because references to the site can be, e.g., embedded in data which is interpreted by JavaScript provided by the site to construct URLs. (It might be possible to use a browser extension to intercept and rewrite such references, but you would need to do it in addition to building the renaming-proxy server.)

The most feasible way to do something like what you want is to create a specialized application which is effectively multiple independent web browsers embedded in a single window. I see that you have already explored browser embedding options. I recommend that you stick with this approach to make what you want happen, and skip attempting to put the multi-browser itself within an ordinary browser.

I assure you that you will not likely find any way to do this that does not involve installing software on the user's computer in some form.