We have developed an API with Symfony3 with a MySQL DB for the persistence. We are running this on Wamp (Apache 2.4, MySQL 5.6, PHP 7.0.10).
The API works well most of the time but, sometimes, after a restart, the bootstrap.php.cache throws an exception caused by this notice:
PHP Notice: Undefined variable: _COOKIE in ....
Here is the entire stack trace coming from the Symfony bowels:
14-Feb-2017 07:36:29 UTC PHP Notice: Undefined variable: _COOKIE in C:\xxx\wamp\www\xxx\var\bootstrap.php.cache on line 453
14-Feb-2017 07:36:29 UTC PHP Fatal error: Uncaught TypeError: Argument 4 passed to Symfony\Component\HttpFoundation\Request::createRequestFromFactory() must be of the type array, null given, called in C:\xxx\wamp\www\xxx\var\bootstrap.php.cache on line 453 and defined in > > C:\xxx\wamp\www\xxx\var\bootstrap.php.cache:1268
Stack trace:
#0 C:\xxx\wamp\www\xxx\var\bootstrap.php.cache(453): Symfony\Component\HttpFoundation\Request::createRequestFromFactory(Array, Array, >Array, NULL, Array, Array)
#1 C:\xxx\wamp\www\xxx\web\app.php(15): Symfony\Component\HttpFoundation\Request::createFromGlobals()
#2 {main}
And this is the line where the stack begins:
$request = self::createRequestFromFactory($_GET, $_POST, array(), $_COOKIE, $_FILES, $server);
It's something strange because, from the stack trace I can know that $_GET, $_POST, and $_FILES are Arrays, but $_COOKIE is not...
Why this var is getting undefined?