XenForo
Administrative
- Thread starter
- Admin
- #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:
And set them via the template renderer
Code:
Any better ways or are they fine?
Read more about this Feed . . .
I figured I can read cookies from the app with
Code:
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?
Read more about this Feed . . .