$auth = new \OneLogin\Saml2\Auth(saml_settings());
$ssoBuiltUrl = $auth->login(null, [], false, false, true);
- $_SESSION['AuthNRequestID'] = $auth->getLastRequestID();
+ DI::session()->set('AuthNRequestID', $auth->getLastRequestID());
header('Pragma: no-cache');
header('Cache-Control: no-cache, must-revalidate');
header('Location: ' . $ssoBuiltUrl);
$auth = new \OneLogin\Saml2\Auth(saml_settings());
$requestID = null;
- if (isset($_SESSION) && isset($_SESSION['AuthNRequestID'])) {
- $requestID = $_SESSION['AuthNRequestID'];
+ if (DI::session()->exists('AuthNRequestID')) {
+ $requestID = DI::session()->get('AuthNRequestID');
}
$auth->processResponse($requestID);
- unset($_SESSION['AuthNRequestID']);
+ DI::session()->remove('AuthNRequestID');
$errors = $auth->getErrors();
$auth = new \OneLogin\Saml2\Auth(saml_settings());
$sloBuiltUrl = $auth->logout();
- $_SESSION['LogoutRequestID'] = $auth->getLastRequestID();
+ DI::session()->set('LogoutRequestID', $auth->getLastRequestID());
header('Pragma: no-cache');
header('Cache-Control: no-cache, must-revalidate');
header('Location: ' . $sloBuiltUrl);
{
$auth = new \OneLogin\Saml2\Auth(saml_settings());
- if (isset($_SESSION) && isset($_SESSION['LogoutRequestID'])) {
- $requestID = $_SESSION['LogoutRequestID'];
+ if (DI::session()->exists('LogoutRequestID')) {
+ $requestID = DI::session()->get('LogoutRequestID');
} else {
$requestID = null;
}