cookies for a different page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

I'd guess you're cookie is not being set, especially since print_r'ing the array didn't return anything....
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

If you're calling print_r($_COOKIE) right at the beginning of the script that's deleting (and ~burrito's right - you can only backdate the expiration date) the cookie, then chances are good that you're not even setting it in the first place. I'd suggest setting the cookie in your first page, then load up a plain page that just outputs cookies. If the cookie still doesn't show up, then you're having problems setting your cookie.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply