• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 2.0 Set and get cookies


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
$request = \XF::app()->container('request');

$cookies = $request->getCookies();
$specificCookie = $request->getCookie('someCookie');
And set them via the template renderer
$renderer->getResponse()->setCookie('name', 'value');
Any better ways or are they fine?