|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-03-29 07:36 UTC] myaddress at iname dot com
If I specify a domain, cookie is not set:
This works:
$exp = time()+120;
setcookie ("TestCookie", "TEST$exp",$exp);
This doesn't work:
$exp = time()+120;
setcookie ("TestCookie", "TEST$exp",$exp, "/", "www.domain.com");
Doesn't set a cookie at all. Any ideas?
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 20:00:02 2025 UTC |
Try this: setcookie("test_cookie", "test$exp", $exp, "/", ".domain.com"); Also, don't forget that you can just write your own header with the header() function. If, for some reason, there *is* a problem with setcookie(), you can always just write your own to be sure. If my above example doesn't fix the problem, please try to give me the HTTP traffic, specifically the response. If you're unsure how to do this, feel free to email me personally. Hope that helps. Chris