0

i'm using php socialAuth, when a user login, it returns an session array like this:

Array
(
[SOCIALAUTH_SESSION] => Array
    (
        [sa_user] => a:102:{s:2:"id";s:5:"13647";i:0;s:5:"13647";s:6:"actief";s:2:"ja";i:1;s:2:"ja";s:8:"voornaam";s:7:"Patrick";i:2;s:7:"Patrick";}
    )

I'm trying to extract the array using this code:

foreach($_SESSION['SOCIALAUTH_SESSION']->$sa_user as $extract)  {

    echo $extract['voornaam'];
}

But i'm receiving this error:

Warning: Invalid argument supplied for foreach() in /home/piadnjxk/domains/xxxxxxxx.xxxxx/public_html/socialauth/signin.php on line 11

What do i do wrong?

1 Answer 1

3

http://php.net/manual/en/function.unserialize.php

var_dump(unserialize($_SESSION['SOCIALAUTH_SESSION']['sa_user']));
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.