Home   Best Sellers   Blogging   Coding & Design   Technology   SEO   Travel & living   Career   Videos   Tips   Calculators     
Home  »     »     »     »     »  How to access object values in Joomla session variable

How to access object values in Joomla session variable

Tuesday, May 15, 2012

How to access object values in Joomla session variable - $_SESSION['__default']

QUERY : in Joomla + i just echo 'ed the following
echo "
ses:
";print_r($_SESSION['__default']);echo "
";

it outputed like this
:


Array
(
    [session.counter] => 34
    [session.timer.start] => 1336983808
    [session.timer.last] => 1336986596
    [session.timer.now] => 1336987030
    [session.client.browser] => Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20100101 Firefox/12.0
    [registry] => JRegistry Object
        (
            [data:protected] => stdClass Object
                (
                    [com_users] => stdClass Object
                        (
                            [registration] => stdClass Object
                                (
                                    [data] => Array
                                        (
                                            [name] => Jack
                                            [email1] => plus
                                            [email2] => admin
                                            [password1] => admin
                                            [password2] =>
                                            [template] => Green
                                            [username] => plus
                                        )

                                )

                        )

                )

        )

    [user] => JUser Object
        (
            [isRoot:protected] =>
            [id] => 0
            [name] =>
            [username] =>
            [email] =>
            [password] =>
            [password_clear] =>
            [usertype] =>
            [template] =>
            [block] =>
            [sendEmail] => 0
            [registerDate] =>
            [lastvisitDate] =>
            [activation] =>
            [params] =>
            [groups] => Array
                (
                )

            [guest] => 1
            [_params:protected] => JRegistry Object
                (
                    [data:protected] => stdClass Object
                        (
                        )

                )

            [_authGroups:protected] => Array
                (
                    [0] => 1
                )

            [_authLevels:protected] => Array
                (
                    [0] => 1
                    [1] => 1
                )

            [_authActions:protected] =>
            [_errorMsg:protected] =>
            [_errors:protected] => Array
                (
                )

            [aid] => 0
        )

    [session.token] => 594e2a13514957ea024b08a653dbfd96
)



--------------------

How to access only the following

[data] => Array
                                        (
                                            [name] => Jack
                                            [email1] => plus
                                            [email2] => admin
                                            [password1] => admin
                                            [password2] =>
                                            [template] => Green
                                            [username] => plus
                                        )

from that session ?




REPLY:


Try this:

$arr_data = $_SESSION['__default']['registry']->data;
print_r( $arr_data );


please post any other solutions to this



How to link to this page?
If you wish to link to this page from your website, simply Copy and paste the above HTML code to your web page. It will appear on your page as:
How to access object values in Joomla session variable.




Share this!




comments powered by Disqus

This Weeks 7 Popular Posts


Subscribe to Recent Posts by Email
Stay connected to CROZOOM with regular Email notices of new Techie articles and IT Jobs. Updates will be delivered to your Inbox as soon as they are posted online.

Enter Your Email Address:  

Delivered by FeedBurner   RSS Feed

Search this Blog   



Urgent Openings for PHP trainees, Andriod / IOS developers and PHP developers in Kochi Trivandrum Calicut and Bangalore. Please Send Your updated resumes to recruit.vo@gmail.com   Read more »