Welcome Guest, Not a member yet? Register   Sign In
Undefined variable COOKIE, core/Input.php
#1

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.
Reply
#2

(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
Reply
#3

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?
Reply
#4

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

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/2310...ite-in-php  but it didn't work.
Reply
#6

Odd. Check server logs. What kind of server is it?
Reply
#7

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.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB