Difference in cookies between PHP4 and PHP5?

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

Post Reply
User avatar
Josh1billion
Forum Contributor
Posts: 316
Joined: Tue Sep 11, 2007 3:25 pm

Difference in cookies between PHP4 and PHP5?

Post by Josh1billion »

Hello all,

I recently tested switching my server from PHP4 to PHP5 (in my hosting account's web panel), and a problem arose: users could no longer log in until I switched back to PHP 4.

Basically, the following line was returning "true" in PHP4 but "false" in PHP5:

Code: Select all

isset($HTTP_COOKIE_VARS['foo'])
..with "foo" being the name of the cookie, of course (replaced in this post for sake of example/simplicity).

---

So, what is the difference between cookie usage in PHP4 and PHP5, if any?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Difference in cookies between PHP4 and PHP5?

Post by Chris Corbyn »

$_COOKIES, obviously the server had register_long_arrays = Off (rightly so).
User avatar
Josh1billion
Forum Contributor
Posts: 316
Joined: Tue Sep 11, 2007 3:25 pm

Re: Difference in cookies between PHP4 and PHP5?

Post by Josh1billion »

Ah that worked, thanks Chris!
Post Reply