Image: Mozilla Firefox

Mozilla is experimenting with a new feature in Firefox that lets users log in to the same site with two different accounts.

Containers is an "experimental" feature in Firefox Nightly version 50, which is designed to reflect the idea that people project different aspects of themselves in different contexts in real life. Containers brings that concept to the web.

Mozilla security engineer Tanvi Vyas says it will allow "users to log in to multiple accounts on the same site simultaneously and gives users the ability to segregate site data for improved privacy and security."

The feature could improve the browser experience for people who currently use two browsers to log in to, say, two separate Twitter accounts or mail accounts at the same time.

It may also benefit those who use a secondary browser to isolate ad trackers from their primary browser. Vyas notes that users can open private tabs to do these tasks, but this approach lacks some of the conveniences of normal mode.

The current implementation of Containers enables separated personal, work, banking, and shopping contexts. Simultaneous logins are achieved by keeping the cookies and cache for each container separate, so that a site from the work container doesn't have access to data from the personal container.

The feature adds a second layer to the familiar tab concept. Users can still open a new generic tab, but they can also open a new "container tab" for each of the four profiles.

While potentially useful, the container tab concept runs the risk of being confusing, which is an issue that Mozilla's engineers acknowledge. Additionally, Containers won't progress to the Firefox Aurora 50 build.

As Vyas notes, the concept of contextual identities on the web isn't new, but it's been difficult to design the right user experience to enable it.

Key questions that Mozilla is hoping to answer through research with users include:

How will users know what context they are operating in?

What if the user makes a mistake and uses the wrong context. Can the user recover?

Can the browser assist by automatically assigning websites to Containers so that users don't have to manage their identities by themselves?

Mozilla's answer to the first question is to use brightly-colored icons to the right of the URL bar, which indicate the context of a particular tab, as well as a corresponding strip of color on top of each tab. Personal is blue, Work is yellow, Banking is green, and Shopping is pink. The regular tab has no colour.

Vyas explains that Mozilla designed Container to "only segregate data that a site has access to, not data that the user has access to".

Cookies, localStorage, indexedDB, and cache are separate while items such as history, permissions, and saved passwords are shared between containers. That approach means if a user is in their Shopping container, they'll be able to see a site they visited from another container in History.

It should also mean that if they're browsing for goods online, they won't be tracked when they move to their personal or work container.

"By separating the data that a site has access to, rather than the data that a user has access to, Containers is able to offer a better experience than some of the alternatives users may be currently using to manage their identities," Vyas wrote.

Read more on Firefox and browsers