Announcement

Collapse
No announcement yet.

Set Cookie Oddities

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Set Cookie Oddities

    Using a custom Component module, I am setting a cookie based on a specific inbound link (with a CGI variable).

    This code has been in place for several years. Over this time a few customers seem to have problems with getting the cookie to write. We've always chalked this up to security-settings/firewallls etc and since un-common, left it at that. However, now I'm seeing this...intermittently. For example, while setting some debugging hooks last night, I notice I wasn't getting the cookie to write on Chrome, but it worked fine on FF. Now, the be more odd, walk into work this morning to resume debugging...and its NOW working in Chrome.

    The Set Cookie routines are being run from Component Module Initialize and the module is assigned to ALL pages.
    Bruce Golub
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
    phosphormedia.com

    #2
    Maybe something is overwriting it? Can you post the code you are using to create/output the cookie?
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Well, maybe, but the oddness is, as I mentioned, its not consistent. This is keyed off a very specific link.
      [code]

      <mvassign name="l.name" value="Voucher">
      <mvassign name="l.value" value="{ g.voucher }">
      <mvassign name="l.domain" value="{ g.domainurl }">
      <mvassign name="l.expires" value="{ SetCookieTime( s.time_t + 43200 ) }">
      <mvassign name="l.path" value="/">
      <mvassign name="l.secure" value="0">

      <mvassign name = "g.cookieVSet" value="{ [ g.Module_Library_Utilities ].SetCookie( g.Output_Cookies, l.name, l.value, l.domain, l.expires, l.path, l.secure ) }">
      <mvassign name = "g.cookieVOut" value="{ [ g.Module_Library_Utilities ].OutputCookies( g.Output_Cookies ) }">
      </code>

      Bruce Golub
      Phosphor Media - "Your Success is our Business"

      Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
      phosphormedia.com

      Comment


        #4
        I'm having a similar issue and I think it has to do with how Chrome manages local storage.

        From Chrome, can you check the domain's cookies and see if there is a local storage cookie. Remove local storage cookie and refresh.

        I remember you had another issue from the admin side. Were you able to solve it?

        http://www.alphabetsigns.com/

        Comment


          #5
          Thanks,

          In part, I believe chrome has been making debugging issues problematic...though other site users may enconter the same problem. (The site has a high degree of returning customers). Part of MY problem is I believe the Add On i've used for years (which prevents caching) is no longer working as I've had two recent issues resolved by simply flushing the cache.

          However, the same problems i've had with the site have been seen by others and not limited to the chrome browser.

          I've moved the cookie code to the custom modules SystemModule_ functions and still have the same random problems. It is my understanding that setting a cookie in SystemModule_Action should mean the cookie values are present as soon as any template rendering starts. But I don't know if I have a way to prove that :).

          Would be nice to have an Flow Chart of all of these interactions, starting with the HTTP request into the mivavm.exe. (HINT HINT HINT)
          Bruce Golub
          Phosphor Media - "Your Success is our Business"

          Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
          phosphormedia.com

          Comment


            #6
            Are you on a CDN like Cloudflare which writes clientside.mvc to local storage and session storage?

            Open Chrome dev tools (F12) > Application > Local Storage. Look for key:value pairs

            The local storage may be overwriting your cookie.
            http://www.alphabetsigns.com/

            Comment


              #7
              For example,

              I was having a problem with my admin UI preferences not refreshing because of Cloudflare writing the KVP's to local storage.

              I was able to resolve the problem by creating a Cloudflare Page rule to bypass cache for URL /mm5/clientside.mvc?T=xxxxxxxx&Filename=admin/ui.js.

              http://www.alphabetsigns.com/

              Comment


                #8
                Yea, nice (and clever) thought, but no such network in use. Pretty sure its a race issue, but hard to track and test.
                Bruce Golub
                Phosphor Media - "Your Success is our Business"

                Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
                phosphormedia.com

                Comment

                Working...
                X