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
And:
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.
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.
Reply
With IE you can run isolated sessions
Menu: File > New session
Reply
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.
Reply
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.
Reply
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.
Reply
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
Reply
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
Reply
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.
Reply
I guess, thinking about it, we could also use Chrome's incognito mode to accomplish this.
Didn't think of mult-user though. Thanks!
Reply
Always used inprivate browsing to do this alongside a standard session.
New session or the trailing dot seem handy.
Great tip.
Reply