First, a bit of background info. I'm working on a multi-site project, 3 cities each with their own installation of a custom CMS type thing. The client doesn't want to pay out for more than one SSL certificate, and despite my suggestion won't even look into a wildcard SSL. My job is to create a unified payment gateway that sits on domain.com/paypment.php, the sites themselves sit on subdomains e.g cityx.domain.com.
Now, on the original payment page the code accesses an object created by the CMS called $_SESSION['member_obj'], and at some point in the code detects the user's account level using:
if ($_SESSION['member_obj']->data['account_level']==1)
So, this works all fine and dandy without any problems, but as soon as I use the same object on my script it breaks. I would like to point out that my code is sitting on the root domain, and the working code on a sub - I have made the $_SESSION variables available to all subdomains using:
ini_set('session.cookie_domain', '.domain.com');
Now, the odd part, the object exists but when I try to use the ->data['account_level'] method, it dies on me. I know the object exists becasue I can print_r the object and I get the following:
__PHP_Incomplete_Class Object
(
[__PHP_Incomplete_Class_Name] => Member
[table] => members
[data] => Array
(
[id] => 1689
[title] => mr
[firstname] => Testy
[surname] => McTesters
[age_range] => 18-24
[gender] => male
[email] => xxxxxx
[username] => xxxxxx
[password] => xxxxxx
[account_level] => 1
[joined] => 1326290317
[password_reset] =>
[password_reset_date] => 01/01/1970
[last_active] => 1326881531
[status] => active
[contact] => 0
[third_party] => 0
[notifications] => 0
[terms] => 1
[dummy] => 0
[override_account] => 0
[premium_request] => 1
[password_reset_date_original] => 1970-01-01
)
followed by a load of other stuff.
So, could anyone be kind enough to explain to me how an object can exist, but not be accessible?
You will have to load the class Member
prior to starting the session.
Check so your session.auto_start
is set to off
in your php.ini
.
Could it - __PHP_Incomplete_Class
- be because you forgot to include
the class definition for the class that encapsulates this data?