0
我想設置安全cookie到本地主機,它不適用於我。我的代碼如下:安全Cookie不工作在PHP
<?php
setcookie("TestCookie", "value1hostonly", time(), "/", "localhost.com", 0, true);
setcookie("TestCookie2", "value2subdom", time(), "/", "localhost", 0, true);
echo @$_COOKIE["TestCookie"];
echo @$_COOKIE["TestCookie2"];
?>
輸出始終顯示空白。請指導我。
domain localhost也是一個問題:http://stackoverflow.com/questions/1134290/cookies-on-localhost-with-explicit-domain –