I get the following error when i logout, if the sms module is enabled.

Error message
Warning: session_destroy() [function.session-destroy]: Trying to destroy uninitialized session in user_logout() (line 175 of C:\xampp_apc\kw3\modules\user\user.pages.inc).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mhaamann’s picture

I have attached a patch that seems to fix the problem when the user logs out. Can anyone verify that this fix is correct?

crazyrohila’s picture

seems like url is broken or this file doesn't exist.

SocialNicheGuru’s picture

would like to test this patch

cashwilliams’s picture

I'm seeing the issue too. Please repost the patch so we can test it!

mcpuddin’s picture

Status: Active » Needs review
FileSize
597 bytes

so the path of the patch was corrupted (the # sign should %23 .. so this should work to see it http://drupal.org/files/sms-session_destroyed_error-1619024-%231.patch )

I looked into the patch and basically the problem is sms_user interferes with sms_user_logout, which actually is invoking hook_user_logout in D7. I remade the patch and changed the name of the function because it was not supposed to invoke hook_user_logout at all.

mcpuddin’s picture

Status: Needs review » Fixed

Committed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Imaaxa-Cory’s picture

Component: SMS Actions » SMS User
Status: Closed (fixed) » Active

I am getting this error, just a bit different.

Warning: session_destroy() [/phpmanual/function.session-destroy.html]: Trying to destroy uninitialized session in sms_user_sms_logout() (line 894 of mysite.com/sites/all/modules/contrib/smsframework/modules/sms_user/sms_user.module).

I checked and the smsframework-sms_user-1619024-5.patch is part of the file. I trying to backtrack what is calling this function and was unable to go back any further than function sms_user_sms_incoming($op, $number, $message, $options).

I am using Drupal core 7.16 also have the Twilio SMS integration 7.x-1.x-dev

ekes’s picture

Status: Active » Needs review
FileSize
5.39 KB

Based on Safely Impersonating Another User I have created one function that switches the user.

It stores the user and session, storing them in a static to be restored after. It then stops session changes, and logs in the SMS user. I have left the call to all the user_login hooks there.

ekes’s picture

  • Commit 18fb5bc on 7.x-1.x, 8.x-1.x by mcpuddin:
    Issue #1619024 by mcpuddin: Fix for user logout
    
  • Commit 48a61f3 on 7.x-1.x, 8.x-1.x by ekes:
    Issue #1619024 by ekes: correct session destroy error, add user switcher...
almaudoh’s picture

Issue summary: View changes
Status: Needs review » Closed (fixed)