EntropySink
Technical & Scientific => Programming => Topic started by: ober on June 21, 2011, 03:00:16 PM
-
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[$class->$var];
? 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.
-
Fuck... got the answer on phpfreaks in like 2 minutes.
$_SESSION['__default']['user']->username
-
Sorry was napping :D