Not able to set cookie in observerMagento Cookie Value Not SetMagento set Cookie?How to Set Session Cookie Based on Query-String Param in MagentoDev/Staging/Live Cookie Domain For Non-www SitesCookie issue with Internet ExplorerM1: cookie issues in example.com and staging.example.comcron observer vs controller action memory issueForm Key cookie is set twice - Magento 2.2.4Listener when message is set in Magento 2Magento 2: Not getting set cookie value in RegisterTrackingObserver

Why would someone open a Netflix account using my Gmail address?

Could there be something like aerobatic smoke trails in the vacuum of space?

God-Pharaoh's Statue and Finale Of Promise

Can a tourist shoot a gun in the USA?

Is the seat-belt sign activation when a pilot goes to the lavatory standard procedure?

APFS - how do I enable transparent compression

Is random forest for regression a 'true' regression?

Formal Definition of Dot Product

How to handle professionally if colleagues has referred his relative and asking to take easy while taking interview

Is my test coverage up to snuff?

How to not get blinded by an attack at dawn

What do you call the hair or body hair you trim off your body?

Why would company (decision makers) wait for someone to retire, rather than lay them off, when their role is no longer needed?

labelled end points on logic diagram

Why can't I share a one use code with anyone else?

Will the volt, ampere, ohm or other electrical units change on May 20th, 2019?

Slice a list based on an index and items behind it in python

Does this "yield your space to an ally" rule my 3.5 group uses appear anywhere in the official rules?

What dog breeds survive the apocalypse for generations?

Is there an academic word that means "to split hairs over"?

enumitem: Understanding the usage of asterisk and exclamation mark in setting the different lengths

Promotion comes with unexpected 24/7/365 on-call

Holding rent money for my friend which amounts to over $10k?

With today's technology, could iron be smelted at La Rinconada?



Not able to set cookie in observer


Magento Cookie Value Not SetMagento set Cookie?How to Set Session Cookie Based on Query-String Param in MagentoDev/Staging/Live Cookie Domain For Non-www SitesCookie issue with Internet ExplorerM1: cookie issues in example.com and staging.example.comcron observer vs controller action memory issueForm Key cookie is set twice - Magento 2.2.4Listener when message is set in Magento 2Magento 2: Not getting set cookie value in RegisterTrackingObserver






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am trying to set a cookie on the observer "catalog_controller_category_init_after" but it does not create the cookie but when I do exit after set cookie it will create cookie after I remove exit from code and run the same code cookie still remains on browse but after I clear the browser cookie and run the same code without exit it will not create a cookie. even tho I tried to set a cookie on the controller and phtml file same thing will happen.










share|improve this question




























    0















    I am trying to set a cookie on the observer "catalog_controller_category_init_after" but it does not create the cookie but when I do exit after set cookie it will create cookie after I remove exit from code and run the same code cookie still remains on browse but after I clear the browser cookie and run the same code without exit it will not create a cookie. even tho I tried to set a cookie on the controller and phtml file same thing will happen.










    share|improve this question
























      0












      0








      0








      I am trying to set a cookie on the observer "catalog_controller_category_init_after" but it does not create the cookie but when I do exit after set cookie it will create cookie after I remove exit from code and run the same code cookie still remains on browse but after I clear the browser cookie and run the same code without exit it will not create a cookie. even tho I tried to set a cookie on the controller and phtml file same thing will happen.










      share|improve this question














      I am trying to set a cookie on the observer "catalog_controller_category_init_after" but it does not create the cookie but when I do exit after set cookie it will create cookie after I remove exit from code and run the same code cookie still remains on browse but after I clear the browser cookie and run the same code without exit it will not create a cookie. even tho I tried to set a cookie on the controller and phtml file same thing will happen.







      magento2 event-observer controllers cookie






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 10 at 14:41









      nikunjnikunj

      11




      11




















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "479"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f274197%2fnot-able-to-set-cookie-in-observer%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f274197%2fnot-able-to-set-cookie-in-observer%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

          Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

          Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form