[php] cookie 跨域共享
<?php
// m.hinabian.com class Controller_Cookie extends Hnb_Base_Controller { public function init() { parent::init(); } public function indexAction() { setcookie('cookie_4000', json_encode($_REQUEST), time()+86400 , '/' , '.hinabian.com'); } public function clsAction() { Hnb_Session::getInstance()->clearSession(); } }
// www.hinabian.com
class Controller_Cookie extends Hnb_Base_Controller { public function init() { parent::init(); } public function indexAction() { var_dump($_COOKIE); print_r($_COOKIE['cookie_4000']); } }
posted on 2015-09-25 19:25 smelikecat 阅读(210) 评论(0) 编辑 收藏 举报