In head, user_logout calls sess_destroy($user->uid) which doesn't only end the current session but all other sessions that user has opened as well.

user_logout should simply call session_destroy() to end the current session. However, this doesn't work anymore because sess_destroy() no longer accepts a session id as parameter. It should, because it is registered as the session destroy handler.

The patch that changed this was http://drupal.org/node/77936 - the code to fix this is even there ;)

Comments

bart jansens’s picture

Version: x.y.z » 5.x-dev
Status: Active » Needs review

Looks like filing a bug report and hoping someone else fixes it, doesn't work ;)

Patch attached.

bart jansens’s picture

StatusFileSize
new2.37 KB

forgot the patch

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new2.03 KB

works as advertised. i tested logout, block a user, and so on.

rerolled to remove fuzz.

dries’s picture

Status: Reviewed & tested by the community » Needs work

I'd prefer to make two functions: session_destroy_uid() and session_destroy_sid().

bart jansens’s picture

Status: Needs work » Needs review
StatusFileSize
new2.95 KB

Allright, here is the patch with two functions.

bart jansens’s picture

StatusFileSize
new3.25 KB

Forgot one call to sess_destroy in the previous patch.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new2.47 KB

tested. works as designed. rerolled since one hunk that had an unrelated comment change was failing.

i grepped contrib and only autologout and remember_me modules use sess_destroy(). i will personally submit a patch for autologout. remember_me has been superceded by persistent_login.module. i think we can say that this is not a significant API change.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Looks good and works. Committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)