Not sure if this is by design or by bug, but when performance tuning my site I discovered that uc_upsell is setting or causing drupal to set a session cookie for anonymous users. This effects advanced caching mechanisms (in my case Varnish).

using the trace module and for anonymous users yields the following from the debug stack trace:

#a7c6e90b T+0.007145 [DEBUG  ] $_SESSION = array('uc_upsell_related' => array('node/1375' => array(...)))

Comments

torgospizza’s picture

Hi,

This is by design (at least it was). We found an issue where, somehow, the "add to cart" buttons were not matching up with the products that were being displayed, and it turned out the easiest way to fix this would be to set a session variable with the related products contained in an array. I realize this is probably not ideal.

I'm totally open to suggestions here, as I'm not sure what the best way to fix this would be. I can think about it and propose something next chance I get, unless someone comes up with something first. :)

torgospizza’s picture

Going to move this up in my list of things todo. We need the module (that's why I wrote it!) but we also need to cache with Varnish. I'm looking for feedback on how back to accomplish this. My first thought is to ajaxify the entire thing, but I'm not sure that's necessary to the extent that we need it here. We just need to get rid of the session stuff, which I'm not sure is even really needed anymore. I didn't write that bit of code, but I saw the issue that it solved and could duplicate it (the forms would change due to their random nature).

If anyone has suggestions I'm happy to listen and implement.

torgospizza’s picture

Priority: Normal » Major

Setting to major.

torgospizza’s picture

Disregard this post. :)