I had something similar specifically with google mail. I use multiple google accounts. I had to be very careful about switching tabs or clicking anything while switching google accounts, or I would find that it would not switch and I'd be stuck back in the account I was already in. I haven't noticed it in a while so perhaps they fixed it.