• 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

katsulynx

Well-known member
#1
What're the most optimal ways to get and set cookies in XF2?

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?