1

In magento 2, For check all current session in magento 2, when we print print_r($_SESSION) then some list of session are display inside browser.

Resultant session look like below,

Array
(
    [_session_validator_data] => Array
        (
            [remote_addr] => 127.0.0.1
            [http_via] => 
            [http_x_forwarded_for] => 
            [http_user_agent] => Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/48.0.2564.82 Chrome/48.0.2564.82 Safari/537.36
        )

    [_session_hosts] => Array
        (
            [141.0.165.165] => 1
        )

    [default] => Array
        (
            [visitor_data] => Array
                (
                    [last_visit_at] => 2016-07-29 14:04:30
                    [session_id] => lc7db6me3qgvm0srirje5pj6c6
                    [visitor_id] => 5530
                )

            [_form_key] => R45hajbDrwRyg2MW
            [currency_code] => GBP
        )

    [customer_base] => Array
        (
        )

    [catalog] => Array
        (
            [last_visited_category_id] => 15
            [last_viewed_category_id] => 15
        )

    [adminhtml] => Array
        (
        )

    [checkout] => Array
        (
        )

    [message] => Array
        (
            [default] => Magento\Framework\Message\Collection Object
                (
                    [messages:protected] => Array
                        (
                        )

                    [lastAddedMessage:protected] => 
                )

        )

    [admin] => Array
        (
        )

)

I want to know how to set default session in magento? at which place currency_code and visitor_data session value are saved?

How can we set session inside default in above code? Any idea would be appericiated.

Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.