I was looking inside Slim 3 and found Slim\Http\Cookies class which may be intended to use in Slim 3 but it never completed and neither mentioned by anyone.
Recently I looked for cookie handler and many of you suggested for dflydev/fig-cookies but I think this library doesn’t work in PHP 7.0 and that’s a big issue to me as I am making applications that run on PHP 7.0 or later.
I would like to get suggestions from you for a good library that works in PHP7.0 otherwise I have to create a new one.
Vanilla PHP Cookies of course work always and everywhere. I’m joking
The most cookie libraries I know are not good maintained anymore or too complex…
except the Symfony Http Foundation library. This library works also very well with Sessions in Slim.
use Symfony\Component\HttpFoundation\Cookie;
$cookie = new Cookie('color', 'green', strtotime('tomorrow'), '/',
'somedomain.com', true, true);
I am trying to use middleware to update the response.
I am using a different approach where a cookie class holds the value and update it using middleware