# Why are users logged out when they toggle compatibility mode in IE?

On the PeoplePerHour website, If a Internet Explorer user toggles the compatibility mode - they get logged out of the website!

What are the possible reasons for this?

I was thinking perhaps the browser is clearing cookies and therefore the users session gets lost. Is this possible (seems unlikely!)?

Test environment: IE8 on Windows Vista.

-
Possibly related question: stackoverflow.com/questions/1130533/… –  Tom Oct 26 '10 at 11:34

It sounds like the session created by that web site is tied to the browser's user agent string, which will change as you switch modes in IE.

-
PeoplePerHour.com uses the PECL memcache session handler which I think is supposed to only use the value of the PHPSESSID cookie for sessions (not the users IP or user agent string)? I submitted a bug: pecl.php.net/bugs/bug.php?id=18789 . –  Tom Sep 29 '10 at 14:45

I just tested it myself by logging into yahoo.com and switching into compatibility mode and I was still logged in. I am running IE8 32 bit on Windows 7. Are you running windows XP or Vista?

Here is any easy way to test.

1. Go to Yahoo's login page (Microsoft's might work as well but Google won't let you switch).
4. Switch to compatibility mode and see what happens.
5. If you do get logged out, check your cookies and see if the yahoo one is gone or has changed. If it hasn't and you are still logged out then login again and clear you cache of non-cookies again. You should be able to find the new cookie for yahoo and be able to compare it. If not then you know the cookie is getting dumped somewhere else and you should know the name of the cookie based off of the old one and you might be able to find in with a search.
-

I am not sure the reason, but DisgruntledGoat's answer is probably correct.

To fix this, you may want to force compatibility mode by adding the following header tag.

<meta http-equiv="X-UA-Compatible" content="IE=7" />