Answer the question
In order to leave comments, you need to log in
COOKIES are not displayed in the Bitrix template?
Good afternoon, in general:
1. I set a cookie in js
2. I get it in the Bitrix component template via $_COOKIE['NAME']
And it works every time, for example: I
made a simple output var_dump($_COOKIE['NAME']) , and the result is either cached or NULL output (although if you look through the developer panel in Application->cookie, everything is set there as it should.
Most likely it's a dirty thing with component caching, but I can't be sure that such things are cached in Bitrix.
ps I tried to get a cookie via $APPLICATION->get_cookie('NAME') - but it doesn't work
Help, tell me how to be and what to do?
Answer the question
In order to leave comments, you need to log in
when composite is enabled, cookies are cached like all other superglobal variables.
use
$frame = new \Bitrix\Main\Page\FrameBuffered("my_dynamic"); // или $this->createFrame() в шаблоне
$frame->begin();
// Содержание динамической области
$frame->beginStub();
// Заглушка
$frame->end();
$APPLICATION->get_cookie('NAME', false)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question