I have weird problem where I'm storing some data in the $_SESSION variable. The problem lies between line 8 and 9. Somehow data is not stored in the session. And I'm clueless where the problem can lie.
When assigning the $data variable to session, it works, but when assining something from $data to session it doesn't work! But the line 7 shows me that accessing the $data array works.
Where is the problem?
Here link is an example of print_r($_SESSION)
code:
1: $ldap = new adLDAP();
2: $ldap->authenticate($username, $password);
3: $ldapUser = $ldap->user();
4: $data = $ldapUser->info($username, $this->ldapInfo);
5: $managerArr = explode(',', $data[0]['manager'][0]);
6: $managerCN = explode('=', $managerArr[0]);
7: $this->log->debug("Display Name = " . $data[0]['displayname'][0]);
8: //$_SESSION['ldap_raw'] = $data; // <--- this freakin works
9: $_SESSION[UserDetails::sessionInfoName][UserDetails::sessionInfoTitleName] = $data[0]['title'][0];
10: $_SESSION[UserDetails::sessionInfoName][UserDetails::sessionInfoTelephoneNumber] = $data[0]['telephonenumber'][0];
11: $_SESSION[UserDetails::sessionInfoName][UserDetails::sessionInfoDisplayNameName] = $data[0]['displayname'][0]);
UserDetails::sessionInfoName and UserDetails::sessionInfoXXXXYYYY are constants defined in the class UserDetails
UserDetails::sessionInfo*and$datamost likely you're referencing array keys that don't exist (and ignoring the notices).$_SESSION[UserDetails::sessionInfoName] = array()first$_SESSIONis an array, of course you can use it like that!