I face new problem in my site, we have reports from users that when they are surfing our site with their account, suddenly logged in as another user and continue surfing site as it.

I searched all modules for below patterns to find where global $user changed by mistake but found nothing.

$user->uid = 
$user = 
->uid = 

Is there any suggestion about this issue?

  • 1
    perhaps the session information is becoming corrupted - do you know what the user was doing just before the 'switch'? – Geoff Jan 5 '15 at 20:50
  • how "session information is becoming corrupted"? They do normal tasks like reading news, submitting comments and ... – Mohammad Ali Akbari Jan 12 '15 at 18:45
  • no clue... maybe a module is causing it, maybe custom code - could be anything. – Geoff Jan 12 '15 at 22:00
  • What modules do you have running? Can you copy the output of drush pml to the question space? That would really help people see what you're running. – Rick Jan 22 '15 at 20:07

I am sure that there is developer mistake here, we have something like you guested,a global $user information overwrite by developer code,I suggest you found when this happened,when a comment submit?when a specified form submit and .... ? I think in custom module your developer first write global $user; and in continue define $user variable,I suggest you search for global $user then look at afterwards codes.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.