Announcement

Collapse
No announcement yet.

Cookie Recipes

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

    Cookie Recipes

    I have a cookie script that WAS working, pulling a stored value out quite nicely (voucher). However, its suddenly stopped. Now, when just evaluating s.http_cookie, I only get two values:

    mm5-S-basket-id=05abff9112b1f5a68b5bc609633b15c1; htscallerid=0e8daeb745f1c276e680cab162a93800

    Yet, in the browser's (FF) information, I see 5

    mm5-S-basket-id
    htscallerid
    voucher
    mm5-admin-session
    mm5-S-basket-id

    and not sure why FF shows the basket id twice...thoughts?
    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
    Re: Cookie Recipes

    How are you generating your cookies? Try setting them via headers if you're currently setting them from <meta> elements.

    Also, check the path on the FF
    mm5-S-basket-id
    cookies. I'm pretty sure that they're set to two different places (maybe '/' and '/mm5/' or something). Also, it might be something hard-coded in there, like "mm5" instead of allowing for something like "Merchant2" or "Merchant5".

    Also, check out SetCookie, in the LSK (lib/util_public.mv). That shows how Miva is now setting their cookies. I've set cookies by calling that before without a hitch.
    Last edited by titus; 07-20-12, 07:00 AM.
    PCINET, LLC

    Miva Merchant Design, Development, Integration & Support
    We built the most Miva Merchant stores!
    Miva shopping cart design & integration service and our Portfolio!

    e-mail: [email protected]
    web: www.pcinet.com

    "We who cut mere stones must always be envisioning cathedrals."
    Quarry Worker's Creed

    Comment


      #3
      Re: Cookie Recipes

      Hi Bruce

      Merchants cookie API uses two calls. The first appends the cookie into the global variable structure g.Output_Cookies. The second actually writes the cookies. The advantage to using the API is that 1) it removes the complexity. 2) it avoids conflicts with other modules that implement their own cookie functions.

      <MvASSIGN NAME = "l.void" VALUE="{ [ g.Module_Library_Utilities ].SetCookie( g.Output_Cookies, l.name, l.value, l.domain, l.expires, l.path, l.secure ) }">
      <MvASSIGN NAME = "l.void" VALUE = "{ [ g.Module_Library_Utilities ].OutputCookies( g.Output_Cookies ) }">

      If your running on MM older than 5.7, copy the functions into your module.
      Ray Yates
      "If I have seen further, it is by standing on the shoulders of giants."
      --- Sir Isaac Newton

      Comment


        #4
        Re: Cookie Recipes

        Thanks Ray...is there a place we could have API examples posted and archived? (sort of like user annotations on Mivascript.org).
        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


          #5
          Re: Cookie Recipes

          I am seeing some cookie weirdness too. You mentioned seeing htscallerid as one of two cookies. That cookie has been around since the last millennium. I have it and several other stores I looked at have it. They were updated too, as they are set to expire 1 year from now. However, I have found two stores that I recently looked at and they do not have that cookie. What's up with that? Why would some stores set and update that cookie and not others? How can we have a non-merchant application and keep track of the flow if the htscallerid is no longer reliable? Is that a bug in merchant or in the engine?
          Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
          Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
          Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
          Facebook http://www.facebook.com/EmporiumPlus
          Twitter http://twitter.com/emporiumplus

          Comment


            #6
            Re: Cookie Recipes

            htscallerid is a bugaboo for PCI certification for some of these supposed scanning services. It can be controlled from the miva.conf file.

            Look at the second post:

            http://extranet.mivamerchant.com/for...ht=htscallerid

            Earliest I read because of problem with McAjoke:

            http://extranet.mivamerchant.com/for...ht=htscallerid

            Comment


              #7
              Re: Cookie Recipes

              Since PR7 we have been advising hosts to disable htscallerid due to the PCI scanner issues and Miva Merchant has attempted to suppress the htscallerid cookie (if it's enabled) for the same reason.

              Modules can set their own cookies using the SetCookie and OutputCookies functions in util.mvc. Non-merchant scripts can output a Set-Cookie header using miva_output_header.

              Comment


                #8
                Re: Cookie Recipes

                Does this mean that s.callerid may be removed in some future version of the engine? Should non-Merchant scripts start migrating away from using this built-in variable and instead force our own cookies? Just to be on the safe side.

                Comment


                  #9
                  Re: Cookie Recipes

                  I'd like to see the cookie kept but make it follow the rules these scan agencies are enforcing, e.g. only set it in non-secure mode. Otherwise we are going to have a free-for-all of various applications setting different cookies for the sole purpose of tracking on the site. Viewing the cookies in the browser tools is going to lead some visitors to question why so many different cookies that appear to be simple session ids.
                  Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
                  Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
                  Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
                  Facebook http://www.facebook.com/EmporiumPlus
                  Twitter http://twitter.com/emporiumplus

                  Comment

                  Working...
                  X