SAML2\Assertion::getSessionNotOnOrAfter PHP Method

getSessionNotOnOrAfter() public method

This function returns null if there are no restrictions on the session lifetime.
public getSessionNotOnOrAfter ( ) : integer | null
return integer | null The latest timestamp this session is valid.
    public function getSessionNotOnOrAfter()
    {
        return $this->sessionNotOnOrAfter;
    }

Usage Example

Example #1
0
 public function validate(Assertion $assertion, Result $result)
 {
     $sessionNotOnOrAfterTimestamp = $assertion->getSessionNotOnOrAfter();
     $currentTime = Temporal::getTime();
     if ($sessionNotOnOrAfterTimestamp && $sessionNotOnOrAfterTimestamp <= $currentTime - 60) {
         $result->addError('Received an assertion with a session that has expired. Check clock synchronization on IdP and SP.');
     }
 }
All Usage Examples Of SAML2\Assertion::getSessionNotOnOrAfter