Lukas W.
Well-known member
What're the most optimal ways to get and set cookies in XF2?
I figured I can read cookies from the app with
And set them via the template renderer
Any better ways or are they fine?
I figured I can read cookies from the app with
Code:
$request = \XF::app()->container('request');
$cookies = $request->getCookies();
$specificCookie = $request->getCookie('someCookie');
And set them via the template renderer
Code:
$renderer->getResponse()->setCookie('name', 'value');
Any better ways or are they fine?