每天laravel-20160822|CookieJar-2
/***Getaqueuedcookieinstance.**@paramstring$key*@parammixed$default*@return\Symfony\Component\HttpFoundation\Cookie*/publicfunctionqueued($key,$default=null){returnArr::get($this->queued,$key,$default);//useafunctiontogetthequeued}//getaqueuedcookieinstance./***Queueacookietosendwiththenextresponse.**@parammixed*@returnvoid*/publicfunctionqueue(){if(head(func_get_args())instanceofCookie){//ifitisinstanceofCookie$cookie=head(func_get_args());//cookiewithsamelikethequeue}else{$cookie=call_user_func_array([$this,'make'],func_get_args());//thiscookiecall_user_func_array()}$this->queued[$cookie->getName()]=$cookie;//setthecookieintothequeue}//queueacookietosendwiththenextresponse./***Removeacookiefromthequeue.**@paramstring$name*@returnvoid*/publicfunctionunqueue($name){unset($this->queued[$name]);}//removeunsetdeleteemptyforget/***Getthepathanddomain,orthedefaultvalues.**@paramstring$path*@paramstring$domain*@parambool$secure*@returnarray*/protectedfunctiongetPathAndDomain($path,$domain,$secure=false){return[$path?:$this->path,$domain?:$this->domain,$secure?:$this->secure];}//getpathdomainsecure./***Setthedefaultpathanddomainforthejar.**@paramstring$path*@paramstring$domain*@parambool$secure*@return$this*/publicfunctionsetDefaultPathAndDomain($path,$domain,$secure=false){list($this->path,$this->domain,$this->secure)=[$path,$domain,$secure];return$this;}//bigset/***Getthecookieswhichhavebeenqueuedforthenextrequest.**@returnarray*/publicfunctiongetQueuedCookies(){return$this->queued;}//returnthequeue
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。