- 🇨🇭Switzerland Lukas von Blarer
I'm facing a similar issue, but not only with varnish. I have the issue under varnish and nginx. I think we are not setting cookies properly in this module. Here are the two occurrences of
setcookie
:setcookie($this->cookieName, json_encode($this->cashiers), time() + $this->cookieDuration, '/');
setcookie('commerce_pos_register', $register->id(), time() + 31557600, '/');
In my opinion we should be setting them as
HttpOnly
andSecure
:setcookie($this->cookieName, json_encode($this->cashiers), time() + $this->cookieDuration, '/', '', TRUE, TRUE);
setcookie('commerce_pos_register', $register->id(), time() + 31557600, '/', '', TRUE, TRUE);
This way the cookies persist across requests.
I'm not exactly sure if we are facing the same issue. So sorry in case I'm hijacking this issue.
- Status changed to RTBC
almost 2 years ago 11:44am 16 March 2023 - Status changed to Needs review
almost 2 years ago 11:44am 16 March 2023 - 🇨🇭Switzerland Lukas von Blarer
Ok, I understood why we are using cookies: We want to store this data across multiple session on the same device.