logo

Quick Tip: Login To Same Site as Two Different Users

Here's a tip I discovered kind of by accident in one of those "I wonder if" moments.

It came about after discovering a Fiddler tip that lets you trace localhost http traffic. The solution is simple: you simply add a trailing space, so that you surf to http://localhost./

At first I'd assumed that this was some odd quirk in the way browsers handled host names. Turns out it's actually working the way it should. Technically speaking all FQDNs should have a trailing space, in order to make them absolute. More here.

It's not just localhost. By way of an example the following two links both work

www.codestore.net

And:

www.codestore.net.

But, what's the tip?

My tip is that you can use the above "hack" to login to (most) websites using two different identities at the same time.

Oftentimes you want to test websites as two different users (even if one of them is "anonymous") and find yourself logging in and out as each user constantly.

Well, using the same browser, you can login as "User 1" at the site with no trailing dot and then as "User 2" in the site with the dot!!

Since discovering this a couple of hours ago it's already saved me an inordinate amount of time.

I know you can always do this by using different browsers (User 1 in Chrome, User 2 in IE) but it's normally the case that using the non-system-default browser ain't so straightforward.

Comments

    • avatar
    • Paul F
    • Wed 21 Aug 2013 02:17 AM

    Thanks, Jake. That is a very useful tip. I have always used the trailing . to speed up DNS lookups but did not realise it could be used for this as well.

  1. With IE you can run isolated sessions

    Menu: File > New session

      • avatar
      • Jake Howlett
      • Wed 21 Aug 2013 07:26 AM

      Interesting. I didn't know about that. I'm sure that IE used to treat a new window being opened (Ctrl+N) as a new session, which I used to find useful.

      If only I could bring myself to use anything other than Chrome as my #1 browser.

    • avatar
    • harkpabst_meliantrop
    • Wed 21 Aug 2013 07:28 AM

    I am shocked to find, that I never new about this. Neither IE sessions nor the dot requirement in a FQDN. :(

    Should probably quit my job and start to sell seashells to tourist in Hawaii or something like that.

      • avatar
      • Jake Howlett
      • Wed 21 Aug 2013 07:30 AM

      That's what I love about this job. You could never know everything and there's always something new to learn.

      Whereas you'd soon know all there is to know about selling seashells on the sea shore.

    • avatar
    • Lee
    • Wed 21 Aug 2013 10:11 AM

    Interesting tip, thanks.

    I've noticed the trailing dot in a few different places (DNS records, SSO configs etc) but never thought to investigate what it's there for.

    When needing to test as multiple users I usually just use a new incognito window in Chrome but will certainly bear the full stop tip in mind.

    Also, FYI I think you've put "trailing space" in your 2nd paragraph instead of "trailing dot".

    Cheers,

    Lee

    • avatar
    • zeniph
    • Wed 21 Aug 2013 08:43 PM

    wow - this is too useful

    only downside for me is that Firefox drops embedded fonts as it doesnt allow them 'cross domain'

    I havent touched notes for over 5 years and always wonder why I wander back here - now I know

  2. Using Chrome's multi-user options is another way to accomplish this. I have 3 different users defined, and can launch individual Chrome windows for each user, and the credentials are kept separate.

      • avatar
      • Jake Howlett
      • Thu 22 Aug 2013 06:57 AM

      I guess, thinking about it, we could also use Chrome's incognito mode to accomplish this.

      Didn't think of mult-user though. Thanks!

    • avatar
    • ianb
    • Sat 24 Aug 2013 01:45 PM

    Always used inprivate browsing to do this alongside a standard session.

    New session or the trailing dot seem handy.

    Great tip.

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Tue 20 Aug 2013

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content