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?
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)
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.
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)
andVendrApi.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 theSet-Cookie
response header?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)
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.
is working on a reply...