Skip to main content

How to access object values in Joomla session variable

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

Popular posts from this blog

Payback Points - How to redeem - How to merge multiple payback accounts - Block Payback card - Payback customer care

Your SBI Debit card ending with XX0000 is deactivated only for Internet txn.

SBI account holders may have received an SMS with following message, supposed to be from State Bank of India (SBI).

Your SBI Debit card ending with XX0000  is deactivated only for Internet txn. To activate send SMS "SWON ECOM 0000" to 09223966666. No change for ATM/POS usage
** Replace the four Zeros with last 4 digits of your debit card number

Recently many of the SBI account holder has losed their money due to a hi-tech ATM robbery which happened in Thiruvananthapuram, capital city of Kerala.

Joomla and Forum Integration - Integrating Forums to Joomla

Joomla is one of the most popular CMS opensource packages. It is very easier to develop website's using Joomla. You just need to download Joomla package from Joomla's Official website www.joomla.org  and install it on your domain and later adding customizations to templates and feature and Your website is ready :). Now a days most websites provides a forum section for it users for discussing various article topics, gathering opinions etc.



Following are some best know forum opensource packages which can be integrated with Joomla and create a new forum experience for users


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 »
Member
Search This Blog