We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
How to read and set session variables
Normal session:
Read a session variable: $readSessionVariable = $_SESSION['my_session'];
$readSessionVariable = $_SESSION['my_session'];
Write a session variable: $_SESSION['my_session'] = $mySessionData;
$_SESSION['my_session'] = $mySessionData;
One-time session
$session = Pi::service('session')->mySession; $session->setExpirationHops(1);
Variables with specific expiration
$session = Pi::service('session')->mySession; $session->setExpirationSeconds(60);