Jump to content

access an object in $_SESSION


ober
 Share

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
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • 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.