PHP code example of phpgt / session
1. Go to this page and download the library: Download phpgt/session library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
phpgt / session example snippets
if($session->contains("auth")) {
// Remove the *whole* auth section of the session on logout.
if($action === "logout") {
$session->delete("auth");
}
else {
// Output a variable within the auth namespace:
$message = "Welcome back, " . $session->getString("auth.user.name");
}
}
else {
// Pass the "auth" store to a class, so it
// can't read/write to other session variables:
AuthenticationSystem::beginLogin($session->getStore("auth"));
}