0
我嘗試在模型中設置cookie,但似乎不起作用。任何想法?ZF2 - 如何在模型中設置cookie?
$header = new \Zend\Http\Header\SetCookie();
$header->setName('Token');
$header->setValue($token);
$header->setPath('/');
$header->setDomain('localhost');
$header->setExpires(time()+(3600*24*365));
$client = new \Zend\Http\Client();
$client->addCookie($header);