Beispiel #1
0
 /**
  *    Reads all the relevant cookies from the
  *    cookie jar.
  *    @param SimpleCookieJar $jar     Jar to read
  *    @param SimpleUrl $url           Url to use for scope.
  *    @access public
  */
 function readCookiesFromJar($jar, $url)
 {
     $this->_cookies = $jar->selectAsPairs($url);
 }
 function testCookieClearByLoweringDate()
 {
     $jar = new SimpleCookieJar();
     $jar->setCookie('a', 'abc', false, '/', 'Wed, 25-Dec-02 04:24:21 GMT');
     $jar->setCookie('a', 'def', false, '/', 'Wed, 25-Dec-02 04:24:19 GMT');
     $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/')), array('a=def'));
     $jar->restartSession('Wed, 25-Dec-02 04:24:20 GMT');
     $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/')), array());
 }