Session Cookie Problems

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Session Cookie Problems

Postby kthxbai2u » 06. November 2007 08:20

I'm not sure if this is a problem with the way my server is configured... or if it is a problem with my programming code. Basically, I set a cookie using

Code: Select all
setcookie("name","test", (time() + (60*2)), "/", ".codinggroundz.com", 0);


Now, that part works fine, because I can see the cookie with firefox. I can see its unencrypted contents.

But... When I try to

Code: Select all
echo "Welcome back, ".$_COOKIES["name"];


it returns nothing O_o I think it may have something to do with the url not matching the server name... so it wont allow to retrieve that cookie. but i checked that. looks normal to me. iono :shock:

[edit] my entire project has come to a grinding halt because of this,.. Someone please help me! :([/edit]
kthxbai2u
 
Posts: 9
Joined: 02. June 2007 05:16

nevermind.... >.<

Postby kthxbai2u » 06. November 2007 11:59

I kept reading, and sorting through all the garbage google spat at me, and everyone else had a different way of doing things, and sucked at explaining it... Most of the code examples had errors... I found that I was just setting the subdomain wrong when i set the cookie... thx :)

changed:
Code: Select all
setcookie("name","test", (time() + (60*2)), "DevCopy/", ".codinggroundz.com", 0);


To:
Code: Select all
setcookie("name","test", (time() + (60*2)), "/DevCopy", ".codinggroundz.com", 0);



And then finally to:
Code: Select all
setcookie("name","test", (time() + (60*2)), "/DevCopy/", ".codinggroundz.com", 0);
kthxbai2u
 
Posts: 9
Joined: 02. June 2007 05:16


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 13 guests