RSS Feed/News Set and get cookies

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
24,728
Points
823

Reputation:

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?

Continue reading...
 
Status
Not open for further replies.
Top