Not sure if this is a bug or something goofy in our configuration, but in 3.1.2 I can login as an admin and logout fine, or login as a reseller and logout correctly, but I have a problem if I login as an admin then switch to a reseller - when I logout of the reseller it correctly takes me back to admin level, but if I hit logout again, instead of logging out completely, it switches back to the reseller, so I end up in a loop (logout of reseller switches to admin, logout of admin switches to reseller). Possibly related, a little earlier today the reseller account was edited under System > CP Users in order to add it to more user groups; it is not a member of the main admin user's group. I don't know if this loop problem happened before then, I didn't try/notice.
To break this loop, you can switch to a client, then logout (as client, back to admin) and logout again (as admin, totally logged out now).