I shared an administrator account with a 3rd party solution provider to debug one of the extensions installed in our store. Now that the problem is fixed I changed the account password.

However this doesn't seem to log out existing backend sessions. They are still logged in (via browser cookie) even after I changed the account password.

Is there any way to force a log out of ALL Magento backend sessions?

  • Delete files from var/session. i think this will work for you – Minesh Patel Feb 18 '16 at 5:14
  • 1
    @MineshPatel, it will work but which sessions exactly to delete? How to know which sessions are backend sessions? Deleting customer sessions may very well hurt sales. – datasn.io Feb 18 '16 at 7:44
  • That is big question. we can not identify session file which are created from frontend or from backend. – Minesh Patel Feb 18 '16 at 7:51

There is a way to find the admin user session file. Please follow below steps to find the admin session files under Magento_Root/var/session/:

Note: below method is use in *nix environment with console utility

Connect to you server through SSH and change your current directory to MAGENTO_ROOT and execute below command:

grep -H -r -n "\"user_id\";s:1:\"7\"" ./var/session/

That's it, you get the lists of admin session file.

What we did here? Using linux grep command we search "user_id";s:1:"7" string inside all session files locate under Magento_Root/var/session directory.

PS: kindly update 7 (administrator id in my case) inside grep search string with your administrator id.

You can delete all listed files.

| improve this answer | |

Jayesh Patel's answer is correct, but i want to extend it. If you have e.g. Redis configured and running for session handling, you also have to clear the Redis database which is assigned for sessions.

But attention: This will clear frontend sessions too!

I also restart PHP5-FPM and Apache too, to be on the real safe side, even if it's too much.

| 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.