Ejemplo n.º 1
0
 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());
 }
Ejemplo n.º 2
0
 function testCookieClearByDate()
 {
     $jar = new SimpleCookieJar();
     $jar->setCookie(new SimpleCookie("a", "abc", "/", "Wed, 25-Dec-02 04:24:21 GMT"));
     $jar->setCookie(new SimpleCookie("a", "def", "/", "Wed, 25-Dec-02 04:24:19 GMT"));
     $cookies = $jar->getValidCookies(false, "/");
     $this->assertIdentical($cookies[0]->getValue(), "def");
     $jar->restartSession("Wed, 25-Dec-02 04:24:20 GMT");
     $this->assertEqual(count($jar->getValidCookies(false, "/")), 0);
 }