奇异的setcookie无效问题

api.xxxx.com/aaa 页面下setcookie,

api.xxxx.com/xxx,cookie 有效

api.xxxx.com/index.php/xxx,cookie 无效

其实是cookie path的问题

setcookie($key, $value, null, ‘/’, null, null);