CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Session Issues
Pages: [1]

Author Topic: Session Issues  (Read 428 times)

JohnFF

  • I post frequently
  • ***
  • Posts: 235
  • Karma: 6
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.28
  • MySQL version: 5.5.31-1
  • PHP version: 5.3.27
Session Issues
October 22, 2013, 09:12:50 am
Hi gang,

So I have a live site and two sites on my local machine.

At civisprint I upgraded one of them (let's call it JohnFF2) to 4.4.

Then, on the other (let's call it JohnFF1), running 4.2 I experienced the following problem:

I'm querying the session to find my ID, then using that to get any relevant memberships. The function I'm using is:
 
$session = &CRM_Core_Session::singleton();
$contactID = $session->get('userID');


However, $session doesn't have a userID field, unless I masquerade as a different user, whereupon it mysteriously all works!

Any ideas?

1) Could doing the upgrade have broken some of my other settings somehow? (I doubt it, but worth asking).
2) How should I be getting my userID if not by this way?
3) Why is it working on the masquerade, and not on the not masquerade?

Thanks,
If you like empowering charities in a free and open way, then you're going to love Civi.

Email Amender: https://civicrm.org/extensions/email-amender
UK Phone Validator: https://civicrm.org/extensions/uk-phone-number-validator
http://civifirst.com
https://twitter.com/civifirst

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Session Issues
October 22, 2013, 09:18:57 am
When messing with sandbox sites it's not uncommon for your users table to get out-of-sync with contacts. For example if you rebuild your civi database but not Drupal, or vice versa.
Try asking your question on the new CiviCRM help site.

JohnFF

  • I post frequently
  • ***
  • Posts: 235
  • Karma: 6
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.28
  • MySQL version: 5.5.31-1
  • PHP version: 5.3.27
Re: Session Issues
October 22, 2013, 09:37:22 am
Makes sense...

And that would bust up user IDs in sessions? I'll try a refresh and see what happens.

(By the way, saw our extensions count on the site - cool bro!)
If you like empowering charities in a free and open way, then you're going to love Civi.

Email Amender: https://civicrm.org/extensions/email-amender
UK Phone Validator: https://civicrm.org/extensions/uk-phone-number-validator
http://civifirst.com
https://twitter.com/civifirst

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Session Issues

This forum was archived on 2017-11-26.