Skip to content

Commit

Permalink
fixed session related methods in Request
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyloris committed Nov 8, 2023
1 parent 1908a94 commit ed9b44a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Components/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,17 @@ public function cookieKeys() {

// get data in $_SESSION : make sure session is started before calling this.
public function sessionData($key) {
// make sure session is running
if (session_status == PHP_SESSION_NONE)
session_start();
return isset($_SESSION[$key]) ? $_SESSION[$key] : NULL;
}


// get all the session keys
public function sessionKeys() {
if (session_status == PHP_SESSION_NONE)
session_start();
return array_keys($_SESSION);
}

Expand Down

0 comments on commit ed9b44a

Please sign in to comment.