You are here

public function SessionStore::get in Auth0 Single Sign On 8.2

Gets persisted values identified by $key. If the value is not set, returns $default.

Parameters

string $key Session key to set.:

mixed $default Default to return if nothing was found.:

Return value

mixed

Overrides StoreInterface::get

File

vendor/auth0/auth0-php/src/Store/SessionStore.php, line 89

Class

SessionStore
This class provides a layer to persist user access using PHP Sessions.

Namespace

Auth0\SDK\Store

Code

public function get($key, $default = null) {
  $this
    ->initSession();
  $key_name = $this
    ->getSessionKeyName($key);
  if (isset($_SESSION[$key_name])) {
    return $_SESSION[$key_name];
  }
  else {
    return $default;
  }
}