Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
主域和www之间共享的HTTP cookie_Http_Cookies_Subdomain - Fatal编程技术网

主域和www之间共享的HTTP cookie

主域和www之间共享的HTTP cookie,http,cookies,subdomain,Http,Cookies,Subdomain,如何创建在www.example.com和example.com之间共享但不在其他子域之间共享的HTTP cookie Cookie cookie = new Cookie("today", "friday"); cookie.setDomain("example.com") -> avaliable to all subdomains 如何使cookie仅对example.com和www.example.com可用?不是abc.example.com。谢谢。AFAIK如果您不能,则.

如何创建在www.example.com和example.com之间共享但不在其他子域之间共享的HTTP cookie

Cookie cookie = new Cookie("today", "friday");
cookie.setDomain("example.com")  -> avaliable to all subdomains

如何使cookie仅对example.com和www.example.com可用?不是abc.example.com。谢谢。

AFAIK如果您不能,则
.example.com
上的cookie集将在www和非www之间共享,但也可以在任何example.com子域之间共享。AFAIK如果您不能,则
.example.com
上的cookie集将在www和非www之间共享,也可以在任何example.com子域之间共享。