用setcookie()时,将域名指定称“localhost”就保存不了cookie怎么回事??
在本地测试的时候发现的。
这样可以设置cookie:
php code setcookie('name[1]', 'yy1', time() + 3600, '/'); setcookie('name[2]', 'yy2', time() + 3600, '/');
这样就不行了:
php code setcookie('name[1]', 'yy1', time() + 3600, '/', 'localhost'); setcookie('name[2]', 'yy2', time() + 3600, '/', 'localhost');
这是为什么?设置称“localhost”不对吗???
谢谢!
------解决方案--------------------
when working on localhost the cookie-domain must be set to or null or false
------解决方案--------------------
探讨
when working on localhost the cookie-domain must be set to or null or false