I have a quite weird situation here, I assume this problem must be a server side issue, but so far I couldn't figure it out how to fix this.

I have a Nginx server with Varnish (I even disabled it totally still got the error) running a Drupal Commerce website on it, the quite funny issue here is the "Add to Cart" button doesn't work on a session without HTTPS, if I add HTTPS in front of my URL, I can add the product to my cart!

I'd really appreciate any help!


The problem was that commerce_cart.module requires a valid session or logged-in user. The security settings of the OP's site prevented sessions being sent out to HTTP requests.
While the OP solved this problem via PHP.ini, there are other valid solutions:

  • Adding session.cookie_secure = 0 in settings.php
  • Requiring all users to use HTTPS.
  • Preventing the cart from displaying to anonymous users.
  • Yea thank you for your answer, I just checked it, looks like our server administrator is doing something on his own, but I guess it's not the issue, I suppose my Live demo is not valid at the moment
    – user23288
    Jul 7 '14 at 8:56
  • You have an issue with image styles, I think. I am getting internal server errors all over the place. Though I doubt this has anything to do with your original issue.
    – GWPROD
    Jul 7 '14 at 9:06
  • Yes the image issue is related to the Temp folder and permission and as you said, it has nothing to do with the original issue. x(
    – user23288
    Jul 7 '14 at 9:10
  • I see no obvious reason why commerce_cart.module would not add to cart under non-ssl. Do you have any secure commerce modules installed? Have you looked at your log messages?
    – GWPROD
    Jul 7 '14 at 9:17
  • no I doubt that there's a secure commerce module, and there's nothing irregular on my log too
    – user23288
    Jul 7 '14 at 9:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy