OneLogin_Saml2_Response::getSessionNotOnOrAfter PHP Метод

getSessionNotOnOrAfter() публичный Метод

Could be used to set the local session expiration
public getSessionNotOnOrAfter ( ) : integer | null
Результат integer | null The SessionNotOnOrAfter value
    public function getSessionNotOnOrAfter()
    {
        $notOnOrAfter = null;
        $entries = $this->_queryAssertion('/saml:AuthnStatement[@SessionNotOnOrAfter]');
        if ($entries->length !== 0) {
            $notOnOrAfter = OneLogin_Saml2_Utils::parseSAML2Time($entries->item(0)->getAttribute('SessionNotOnOrAfter'));
        }
        return $notOnOrAfter;
    }

Usage Example

Пример #1
0
 /**
  * Tests the getSessionNotOnOrAfter method of the OneLogin_Saml2_Response
  *
  * @covers OneLogin_Saml2_Response::getSessionNotOnOrAfter
  */
 public function testGetSessionNotOnOrAfter()
 {
     $xml = file_get_contents(TEST_ROOT . '/data/responses/response1.xml.base64');
     $response = new OneLogin_Saml2_Response($this->_settings, $xml);
     $this->assertEquals(1290203857, $response->getSessionNotOnOrAfter());
     // An assertion that do not specified Session timeout should return NULL
     $xml2 = file_get_contents(TEST_ROOT . '/data/responses/response2.xml.base64');
     $response2 = new OneLogin_Saml2_Response($this->_settings, $xml2);
     $this->assertNull($response2->getSessionNotOnOrAfter());
     $xml3 = file_get_contents(TEST_ROOT . '/data/responses/valid_encrypted_assertion.xml.base64');
     $response3 = new OneLogin_Saml2_Response($this->_settings, $xml3);
     $this->assertEquals(2696012228, $response3->getSessionNotOnOrAfter());
 }
All Usage Examples Of OneLogin_Saml2_Response::getSessionNotOnOrAfter