setcookie路径网址在PHP中不起作用?

时间:2012-11-07 06:41:50

标签: php cookies subdomain setcookie

/foo/controllers/调用以下代码时:

setcookie(
    "email", $email, time() + 100 * 60 * 60 * 24 * 30, 
    "/foo/", "bar.com", false
);

它获得了价值(从FireBug复制):

# line-breaks added for aesthetics
email=stackoverflowuser95%40gmail.com; 
    expires=Sun, 24 Jan 2021 06:25:33 GMT; 
    path=/foo/controllers/; domain=bar.com

如何设置Cookie以使Cookie对/foo/controllers//foo/views/有效?

0 个答案:

没有答案