We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

userdata['session_id'] is null for some users

Development and Programming

James Spibey's avatar
James Spibey
23 posts
15 years ago
James Spibey's avatar James Spibey

Hi,

I’ve developed a module for EE 2.x which has been working great. We use the current user’s session id to track a shopping cart for them but are finding that for a minority of users their session_id is reported as empty. The code I’m using to get the session ID is

$this->EE->session->userdata['session_id']

For certain users this is empty. All users are authenticated so are logged in prior to this code being fired.

Can you explain why this might be?

Thanks

James

       
James Spibey's avatar
James Spibey
23 posts
15 years ago
James Spibey's avatar James Spibey

Any help with this? Is it a bug in EE?

       
the3mus1can's avatar
the3mus1can
426 posts
15 years ago
the3mus1can's avatar the3mus1can

Can you do a var_dump on a users userdata when their session_id is empty to see what else is in there. A possible work around would be to use their member_id instead of the session_id.

       
James Spibey's avatar
James Spibey
23 posts
15 years ago
James Spibey's avatar James Spibey

The rest of the data appears to be complete but session_id is actually 0 rather than NULL. Unfortunately I can’t do a var_dump as I can’t reproduce it locally, only on our live site.

I’ve also logged this as a bug (https://support.ellislab.com/bugs/detail/14465/) and made the change suggested there but to no avail.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.