Saturday, April 7, 2012

Force new session in browser

I recently happened on this when investigating an issue for a customer.

Generally end users have very little control over whether the browser decides to begin a new user session when revisiting a website/web-application or whether it uses a current session (which may be open in another browser instance or tab). Often the end user will not care about this but sometimes they will as it may have undesirable effects on what they are attempting to do.

For example when attempting to use multiple different user accounts to access an application such as logging into two different Gmail accounts. In this scenario you may want to log in more than once without loosing your previous session.

One method and probably the most obvious would be to use a completely different browser, such as IE and Chrome. This provides the added benefit of being able to easily identify the two different sessions from the Windows Taskbar. However this is not always possible especially in a locked down enterprise environment where only a single browser may be available.

Internet Explorer 8 Onwards

From Internet Explorer 8 onwards it is possible to force a new Window to use a new session, using the, ‘New Session’ item on the file menu.

image

For those who are calling out that there is no menu in IE8+, try clicking the ALT key on the keyboard and hey presto the menu appear as if by magic!

Alternatively this can be achieve from the command line or shortcut by appending the –nomerge command line option. This will launch a new Internet Explorer window without sharing the session information.

“C:\Program Files (x86)\Internet Explorer\iexplore.exe” –nomerge

Alternative browsers

This post was triggered from an issue in a customers environment, where they were using Internet Explorer, however the session behaviour described above is apparent in all the popular browsers.

Google Chrome

It is possible to open a new window without without the history and a new session by using the Incognito mode. ‘New Incognito Window’ from the wrench tool on the toolbar, or using the Ctrl+Shift+N keyboard shortcut.

This will open a new window in a new session, however it will also have the impact that no cookies or history will be stored once the session is ended.

If more control is required then a browser extension can be installed to allow management of the various session that are in use within the browser.

Firefox

An equivalent is not provided out of the box for Firefox, however it is achievable using a browser extension, such as IE Tab, which uses the IE Engine to render the tab contents so that two different sessions can be active at one time.

No comments:

Post a Comment