Jump to content

access an object in $_SESSION


ober

Recommended Posts

I'm just trying to determine if the user is logged into a Joomla site and inside the Session, they have objects that hold the information.  But how do I access those objects?

 

$_SESSION['__default'][$user->$username];

 

?  Nothing I try seems to work.

 

Here is the structure of the dump from $_SESSION:

Array
(
    [__default] => Array
        (
            [session.counter] => 3
            [session.timer.start] => 1308682834
            [session.timer.last] => 1308682837
            [session.timer.now] => 1308682837
            [session.client.browser] => Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0
            [registry] => JRegistry Object
                (
                    [_defaultNameSpace] => session
                    [_registry] => Array
                        (
                            [session] => Array
                                (
                                    [data] => stdClass Object
                                        (
                                        )

                                )

                        )

                    [_errors] => Array
                        (
                        )

                )

            [user] => JUser Object
                (
                    [id] => 0
                    [name] => 
                    [username] => 
                    [email] => 
                    [password] => 
                    [password_clear] => 
                    [usertype] => 
                    [block] => 
                    [sendEmail] => 0
                    [gid] => 0
                    [registerDate] => 
                    [lastvisitDate] => 
                    [activation] => 
                    [params] => 
                    [aid] => 0

 

There is more to it but I need to access the stuff in the 'user' object.

Link to comment
https://forums.phpfreaks.com/topic/240029-access-an-object-in-_session/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.