[RSS Feed/News] Set and get cookies

Status
Not open for further replies.

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:

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 . . .
 
Status
Not open for further replies.
Back
Top Bottom