CodeIgniter Forums
Undefined variable COOKIE, core/Input.php - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: Undefined variable COOKIE, core/Input.php (/thread-68591.html)



Undefined variable COOKIE, core/Input.php - usr_ny - 08-01-2017

I'm getting a notice that _COOKIE is undefined.

it seems the error is coming from line 627 of "core/Input.php"

Why am I getting this notice message (I know the $_COOKIE variable is undefined) and how to I resolve it (make the notice go away and PHP happy)?

I'm not explicitly using cookies, trying to read them etc - but I am using sessions.

Thanks.


RE: Undefined variable COOKIE, core/Input.php - Paradinight - 08-01-2017

(08-01-2017, 10:51 AM)usr_ny Wrote: I'm getting a notice that _COOKIE is undefined.

it seems the error is coming from line 627 of "core/Input.php"

Why am I getting this notice message (I know the $_COOKIE variable is undefined) and how to I resolve it (make the notice go away and PHP happy)?

I'm not explicitly using cookies, trying to read them etc - but I am using sessions.

Thanks.

codeigniter version?

// Also get rid of specially treated cookies that might be set by a server <- this is line 627 Dodgy


RE: Undefined variable COOKIE, core/Input.php - usr_ny - 08-01-2017

version 3.1.0 of CI.

I've been trying to delete $_SERVER['HTTP_COOKIE'] and $_COOKIE, but the error isn't going away.

Are you saying i should delete the 'Clean $_COOKIE Data' section (lines 627-651) from core/Input.php?


RE: Undefined variable COOKIE, core/Input.php - skunkbad - 08-01-2017

Try replacing your system directory with a fresh copy of the same version.


RE: Undefined variable COOKIE, core/Input.php - usr_ny - 08-01-2017

Thanks skunkbad.

It didn't work.  I tried replacing the system directory with a fresh copy from the same version, and then I tried using the system directory from the most recent CI version - none made the error message go away.

I rebooted the server and that made the error go away, but i don't comfortable with that solution.  Any suggestion would be appreciated.

I also tried this https://stackoverflow.com/questions/2310558/how-to-delete-all-cookies-of-my-website-in-php  but it didn't work.


RE: Undefined variable COOKIE, core/Input.php - skunkbad - 08-01-2017

Odd. Check server logs. What kind of server is it?


RE: Undefined variable COOKIE, core/Input.php - Narf - 08-03-2017

1. Look for "variables_order" in your php.ini - if there's no "C" in the value, that's your problem.
2. Look for unset($_COOKIE) - if you did that, revert it.
3. STOP MODIFYING FRAMEWORK FILES! You're not supposed to and you obviously don't know what you're doing.
4. If all of this is about a CLI script - then no problem exists at all. CLI is not HTTP; there's no cookies, or sessions.