public function toArray()
    {
        return array(
            'name'   => $this->name,
            'value'  => $this->value,
            'path'   => $this->path,
            'domain' => $this->domain,
            'secure' => $this->isSecure,
            'expiry' => null === $this->expiry ? null : $this->expiry->getTimestamp()
        );
    }