Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Get php session data

I set a php session like such:

session_start();
$_SESSION['user_auth'] = [
    "email" => $resultObj->email,
    "displayName" => $resultObj->displayName,
    "token" => $resultObj->token
];

I can’t find anything in my searches that’s helpful yet, but how can I reference this session data later to use the token for another request?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

It’s a 2d array so you can access it as you’d normally do for array types.

Like

echo $_SESSION['user_auth']["email"];
echo $_SESSION['user_auth']["displayName"];
echo $_SESSION['user_auth']["token"];
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading