I try to get the $app->setCookies()
and $app->getCookies()
to work.
So heres my $app
config:
$app = new \Slim\Slim(array(
'view' => new \Slim\Views\Twig(),
'debug' => true,
'cookies.encrypt' => false, // <= so it is no encrypt bug
'cookies.secret_key' => '6yxwi8fg4tr72', // <= just random digits
'cookies.cipher' => MCRYPT_RIJNDAEL_256,
'cookies.cipher_mode' => MCRYPT_MODE_CBC
));
The Middleware that I added is just injecting some variables. [No SessionMiddleware]
$app->get('/login',function () use ($app) {
$app->setCookie('admin', true);
$app->redirectTo('home');
});
According to the Answer on: Why won't asp.net create cookies in localhost? edited the /etc/hosts file.
However no matter what I do, whenever $app->setCookies()
is called, I retrieve only a blank page. If I comment it out, I get redirected to my homepage. No errors are thrown as well.