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

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

          Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

          Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?