Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

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
add comment

2 Answers 2

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? –  H-L Apr 16 at 18:42
    
Just did that and work like a charm :) –  H-L Apr 16 at 19:13
add comment

I wrote up a small drush command to do this:

$ drush help session-delete
Delete user sessions from the database.
Examples:
 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
add comment

Your Answer

 
discard

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.