Home > Mobile >  Get php session data
Get php session data

Time:03-04

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?

CodePudding user response:

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"];
  •  Tags:  
  • php
  • Related