Announcement

Collapse
No announcement yet.

Delete Cookie Problem

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

    Delete Cookie Problem

    I have the following code at the beginning of the ACED page:
    <mvt:if expr="g.Action AND g.Action EQ 'ICST'">
    <mvt:item name="toolkit" param="pgrpinsert|maxgrp|CustomerLoyalty" />
    <mvt:assign name="g.cookie_count" value = "miva_struct_members( g.request_cookies, g.cookies)" />
    <mvt:if expr="'__ss_loyalty' CIN g.cookies">
    <mvt:item name="couponrd" param="addpoints|Initialized|Welcome Bonus Points|'100'" />
    <mvt:assign name="g.output_header" value="miva_output_header('Set-Cookie','__ss_loyalty=valid; expires=Tue, 24-Jul-2010 00:00:01 GMT; path=/;')" />
    </mvt:if>
    </mvt:if>
    In the last step, I'm attempting to delete the previously checked cookie by setting it to a past date. It appears that the cookie is in fact being deleted as desired, but I am also somehow losing the logged-in state (although the customer link at the top of the screen seems to imply they are, clicking on it brings you to the LOGN page instead of the ACLN page.)

    Any ideas on why this is happening? Thanks in advance.

    Paul
    Paul

    #2
    It's likely that your Set-Cookie header is overwriting the Miva Cookies with get output the same way. A better way to do it is in template code or this can also be done in JavaScript:

    https://docs.miva.com/code-samples/set-cookie
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Thanks for the advice. That method worked like a charm. Just as an FYI, I got the original method from this webpage: https://docs.miva.com/videos/working-with-cookies .

      Paul

      Comment

      Working...
      X