We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17771
    • 14 Posts
    Hi,

    This is my current situation.

    Through my home page I submit a form and then store these values in a cookie and then redirect it to another page. I check the cookies through the browser. Everything works fine.

    Now when I again enter my home page and enter different set of details, the same thing should repeat but the information displayed in the redirected page has obsolete value.

    I checked the cookie in the browser and it has the updated value. But the redirected page display an obsolete value. I do not know how this is happening. I suspect that the superglobal variable $_COOKIE that I am using in a snippet in my redirected page does not contain the updated cookie information.

    Please help me with this issue. I have been struggling with this issue for a week now.

    --
    Vinzy
      Vinzy
      • 3749
      • 24,544 Posts
      If the page is cached, try calling the snippet uncached. If the page is uncached, call the snippet cached. (I assume you’re not using MODx Revolution.)

      BTW, is there a reason you want to use a $_COOKIE rather than a $_SESSION variable?
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 17771
        • 14 Posts
        Hi,
        There is one specific reason. My session variable is continuously getting reset when I redirect to another page. This is reason I am trying to use a cookie in place of the session variable. I tired calling the snippet with cache disabled. Still the cookie value that is displayed is obsolete. :-(
        --
        Vinzy
          Vinzy
          • 17771
          • 14 Posts
          Hi,

          By calling the snippet with cache disabled actually solved the problem. Hurray..Thanks a lot for your help

          --
          Vinzy
            Vinzy
            • 3749
            • 24,544 Posts
            Glad it worked. wink

            This problem goes away in MODx Revolution but in your version, caching is kind of reversed from what you’d expect at each level as you move throuth the levels of nested elements.
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting