Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was using a computer somewhere to login my site as admin, but forgot to logout. How can I logout my account from another computer?

share|improve this question
up vote 7 down vote accepted

I think you can just remove the relevant entries from the sessions table:

db_delete('sessions')->condition('uid', $your_user_id)->execute();

That should log the user out everywhere.

share|improve this answer
Thank You Clive. Can I use the phpmyadmin and delete all my "uid" rows under "sessions" section? – CocoSkin Apr 16 '14 at 18:42
Just did that and work like a charm :) – CocoSkin Apr 16 '14 at 19:13

I wrote up a small drush command to do this:

$ drush help session-delete
Delete user sessions from the database.
 drush session-delete all                  Delete all sessions.
 drush session-delete 64                   Delete sessions for user id 64.
Aliases: sess-del

Technically, this just deletes the session and doesn't do a proper logout. Those are nearly identical, though, under most circumstances.

This patch hasn't been committed, so you would need to download drush extras and apply it, or just extract the file from the patch and add it to your local commands.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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