dongxunhua2054 2018-09-08 20:44
浏览 47

为什么WooCommerce不在自定义域上设置Cookie?

I'm building support to use custom domains on a WooCommerce store. Everything works except for the cookies being set by WooCommerce to track session data.

On the original domain (viaglamour), I can add a product to cart via ajax and the cart will seamlessly update with the new products. The correct cookies are set and updated to track the session. On a custom domain rendering the exact same store page, the cookies are never set causing the checkout, cart, and update functionalities to hang forever.

I've tried forcing AJAX requests to always go through the home domain, manually setting cookies, experimenting with CORS policies but I always return back to square one - the woocommerce functionality that depends on AJAX and JS doesn't work.

Original domain: https://viaglamour.com/cart/?add-to-cart=6936 (Fully works!)

Custom domain: https://learnlowpoly.com/cart/?add-to-cart=6936 (No cookies for woocommerce_cart_hash).

In both URLS ajax should be creating the session data and displayed (1) product.

I'm genuinely unsure if this is A) even possible B) the complexity of overriding WC core.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 如何用stata画出文献中常见的安慰剂检验图
    • ¥15 c语言链表结构体数据插入
    • ¥40 使用MATLAB解答线性代数问题
    • ¥15 COCOS的问题COCOS的问题
    • ¥15 FPGA-SRIO初始化失败
    • ¥15 MapReduce实现倒排索引失败
    • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
    • ¥15 找一位技术过硬的游戏pj程序员
    • ¥15 matlab生成电测深三层曲线模型代码
    • ¥50 随机森林与房贷信用风险模型