{"id":16651360,"date":"2023-04-13T09:12:56","date_gmt":"2023-04-13T09:12:56","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/the-wc_setcookie-function-does-not-work-when-the-page-is-cached\/"},"modified":"2023-04-13T09:12:56","modified_gmt":"2023-04-13T09:12:56","slug":"the-wc_setcookie-function-does-not-work-when-the-page-is-cached","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/the-wc_setcookie-function-does-not-work-when-the-page-is-cached\/","title":{"rendered":"The wc_setcookie function does not work when the page is cached"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hi,<br \/>I&#8217;m having a problem with the wordpress wc_setcookie function.<br \/>Once the page is cached, I use the wc_setcookie( &#8216;woocommerce_recently_viewed&#8217;, implode( &#8216;|&#8217;, $viewed_products ),$expire ); however, when I check with F12 on the Browser, I don&#8217;t see the cookie: woocommerce_recently_viewed<br \/>If the page is not cached or the page uses ESI, then F12 on the Browser will have a Cookie.<br \/>Can you tell me how can i use wc_setcookie function for cached page?<br \/>Thank you!<\/p>\n","protected":false},"template":"","class_list":["post-16651360","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16651360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16651360\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=16651360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}