Cookies in PHP

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Greetings. I am attempting to get this cookie working for a website I
am running. The code to create the cookie is as follows, when I run it
on my localhost it works perfectly, however when uploaded it does not
work. I confirmed the variables ($username, $password) are fine, but
can't get it to work ! Someone please help me !

setcookie("sitedata_username", $username, time()+3600, "/",
"", 0);
setcookie("sitedata_password", $password, time()+3600, "/",
"", 0);

Re: Cookies in PHP

*** Kurt A. Kaylor wrote/escribió (16 Jul 2004 00:11:31 -0700):
Quoted text here. Click to load it

I see you are setting a domain for the cookie. Make sure it isn't a
security issue in your web browser (some browsers are configured not to
accept cookies for third-party domains).

Also, make sure the issue is not in reading the cookie. $_COOKIE variable
didn't exist in older PHP versions.

-- Álvaro G. Vicario - Burgos, Spain

Site Timeline