Symfony\Component\BrowserKit\Cookie::isHttpOnly PHP Method

isHttpOnly() public method

Returns the httponly flag of the cookie.
public isHttpOnly ( ) : boolean
return boolean The cookie httponly flag
    public function isHttpOnly()
    {
        return $this->httponly;
    }

Usage Example

 public function testIsHttponly()
 {
     $cookie = new Cookie('foo', 'bar');
     $this->assertFalse($cookie->isHttpOnly(), '->isHttpOnly() returns false if not defined');
     $cookie = new Cookie('foo', 'bar', 0, '/', 'foo.com', false, true);
     $this->assertTrue($cookie->isHttpOnly(), '->isHttpOnly() returns the cookie httponly flag');
 }