isExpired() public method

Returns true if the cookie has expired.
public isExpired ( ) : boolean
return boolean true if the cookie has expired, false otherwise
Beispiel #1
3
 public function testIsExpired()
 {
     $cookie = new Cookie('foo', 'bar');
     $this->assertFalse($cookie->isExpired(), '->isExpired() returns false when the cookie never expires (null as expires time)');
     $cookie = new Cookie('foo', 'bar', time() - 86400);
     $this->assertTrue($cookie->isExpired(), '->isExpired() returns true when the cookie is expired');
     $cookie = new Cookie('foo', 'bar', 0);
     $this->assertFalse($cookie->isExpired());
 }