How to remove all active sessions for given uid who has logged in from different browsers or apps.

I used


but old sessions still valid and user can create content from apps having that sessions.

I need to delete all sessions for that user and create new one .

1 Answer 1


Why not just delete the corresonding entries from the sessions table? e.g. in sql, delete from sessions where uid = <uid>

This won't work if you're using memcache for your sessions table, but I imagine there's an equivalent if you are.

  • 1
    It comes to my mind but I need a solution based on drupal api to cope with all situations and not to bypass hook_user_logout invoking, Your answer is highly appreciated Mar 4, 2015 at 8:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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