0

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

I used

drupal_session_destroy_uid($uid);
drupal_session_regenerate();

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

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.

  • 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 – Mohammed Gomma Mar 4 '15 at 8:57

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.