chrome 打開頁面 http://127.0.0.1:8082
,使用到session
$session = $request->session();
//重新設(shè)置ticket
$wechatTicket = $session->get('wechatTicket','');
if (!$wechatTicket){
$wechatTicket = Str::random(40);
$session->set('wechatTicket',$wechatTicket);
}
return "hello";
在chrome 下能正確顯示。
但是firfox、Safari 等瀏覽器打開同一個頁面。報錯?。?!
Request->session() fail, header already send
定位于Workerman\Protocols\Http\Request 第305行 $this->connection === null 成立!
用了swoole?估計是開了swoole協(xié)程導致的