Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • David Peck 687 posts 1863 karma points c-trib
    Mar 24, 2021 @ 10:19
    David Peck
    0

    Cookie creation

    I'm trying to setup some heavy caching on Cloudflare, and running in to issues with the Set-Cookie response header being cached.

    I can see that being selective with my VendrApi.Instance.GetOrCreateCurrentOrder(storeId) and VendrApi.Instance.GetCurrentOrder(storeId) calls gives me some control over creation of the Vendr cookie. Are there any other conditions that I should be aware of that would result in the Set-Cookie response header?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Mar 24, 2021 @ 10:27
    Matt Brailsford
    1

    Hey David,

    Any interaction with the session manager can result in a cookie being made (note, the VendrApi is a wrapper around most of the Vendr services for convenience, but under the hood it just calls the wrapped services methods, of which the GetCurrentOrder etc are session manager methods).

    Generally speaking, creating a new order or setting any of the sessions defaults will write a cookie and then when the current order becomes finalized, any access to the current order will perform a "check and move" action which checks to see if the current order has become finalized and if so, moves it to the current finalized order cookie and the "current order" cookie value is cleared.

    Matt

    Update: Also, the current order is moved to the finalized order slot on return from the payment gateway so this will also be a time when a cookie is updated via the session manager (the "check and move" referred to above is kind of a failsafe)

  • David Peck 687 posts 1863 karma points c-trib
    Mar 24, 2021 @ 12:03
    David Peck
    0

    OK, thank you. That's all great.

    I can manage cookie creation as a result of my actions, I was just concerned that there could be something added to the normal request/response pipeline that would create something.

Please Sign in or register to post replies

Write your reply to:

Draft