session 不能跨域名的。
cookie 也不能跨域名。
setcookie 只是再浏览器中发送cookie ,好像再客户端没有生成cookie.
你尝试用javascript 写cookie.然后再判断。