fromString() 공개 정적인 메소드

Creates cookie from raw header string.
public static fromString ( string $cookie, boolean $decode = false ) : static
$cookie string
$decode boolean
리턴 static
예제 #1
0
    public function testFromString()
    {
        $cookie = Cookie::fromString('foo=bar; expires=Fri, 20-May-2011 15:25:52 GMT; path=/; domain=.myfoodomain.com; secure; httponly');
        $this->assertEquals(new Cookie('foo', 'bar', strtotime('Fri, 20-May-2011 15:25:52 GMT'), '/', '.myfoodomain.com', true, true, true), $cookie);

        $cookie = Cookie::fromString('foo=bar', true);
        $this->assertEquals(new Cookie('foo', 'bar'), $cookie);
    }