If you use the WooCommerce Stripe Gateway extension in combination with RunCloud’s server-level caching, there’s a chance that it’ll conflict with our caching behavior.

On a fundamental level, this is because the WooCommerce Stripe Gateway plugin constantly checks and sets the WooCommerce session again on every single product page (if not already set). This can conflict with caching on your site.

Note: Before proceeding with the steps outlined in this knowledgebase article, we advise you to test in a separate staging environment with the WooCommerce Stripe Gateway extension disabled to see if this addresses the issue. If not, then the chances are that the issue is not related to the fix that is documented here.

When RunCloud Hub is in use, the session set is cached by NGINX (as it should be), but when both plugins are used in combination with one another, this can result in someone getting the same cart session from the database as another user.

To prevent this from happening, add the following rules to your NGINX custom config.

This should be added to location.http.WEBAPP_NAME.conf:

map $upstream_bytes_received $tereostaging_hide_cookie {
   default '';
   '' Set-Cookie;
}

This should be added to location.proxy.WEBAPP_NAME.conf:

header_filter_by_lua_block {
   ngx.header[ngx.var.tereostaging_hide_cookie] = nil;
}

Please test this workaround thoroughly. At this point, you can safely apply the same configuration rules to any website that uses both RunCloud Hub and the WooCommerce Stripe Gateway extension.

Important note: In the above configuration rules, you can see the tereostaging_hide_cookie cookie in both configs. This needs to be changed so that it is unique for every single web app. For example, in production you can use tereo_hide_cookie in the config instead.