NervJS / taro

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
https://docs.taro.zone/
Other
35.61k stars 4.8k forks source link

@tarojs/plugin-http 不支持多域名cookie #15436

Open xiaoxintang opened 7 months ago

xiaoxintang commented 7 months ago

相关平台

微信小程序

小程序基础库: 3.3.5 使用框架: React

复现步骤

plugins: [ [ "@tarojs/plugin-http", { enableCookie: true, disabledFormData: false, disabledBlob: false, }, ], ]

使用不同的接口域名去请求,带的cookie会混乱,cookie变成跟域名无关

期望结果

cookie跟域名关联

实际结果

cookie会混乱,cookie变成跟域名无关

环境信息

👽 Taro v3.6.25

  Taro CLI 3.6.25 environment info:
    System:
      OS: Windows 10 10.0.19045
    Binaries:
      Node: 20.10.0 - E:\_app\dev\nodejs\node.EXE
      Yarn: 4.1.1 - ~\AppData\Roaming\npm\yarn.CMD
      npm: 10.5.0 - E:\_app\dev\nodejs\npm.CMD
    npmPackages:
      @tarojs/cli: 3.6.22 => 3.6.22
      @tarojs/components: 3.6.22 => 3.6.22
      @tarojs/helper: 3.6.22 => 3.6.22
      @tarojs/plugin-framework-react: 3.6.22 => 3.6.22
      @tarojs/plugin-platform-alipay: 3.6.22 => 3.6.22
      @tarojs/plugin-platform-h5: 3.6.22 => 3.6.22
      @tarojs/plugin-platform-jd: 3.6.22 => 3.6.22
      @tarojs/plugin-platform-qq: 3.6.22 => 3.6.22
      @tarojs/plugin-platform-swan: 3.6.22 => 3.6.22
      @tarojs/plugin-platform-tt: 3.6.22 => 3.6.22
      @tarojs/plugin-platform-weapp: 3.6.22 => 3.6.22
      @tarojs/react: 3.6.22 => 3.6.22
      @tarojs/runtime: 3.6.22 => 3.6.22
      @tarojs/shared: 3.6.22 => 3.6.22
      @tarojs/taro: 3.6.22 => 3.6.22
      @tarojs/taro-loader: 3.6.22 => 3.6.22
      @tarojs/webpack5-runner: 3.6.22 => 3.6.22
      babel-preset-taro: 3.6.22 => 3.6.22
      eslint-config-taro: 3.6.22 => 3.6.22
      react: ^18.0.0 => 18.2.0
15157757001 commented 4 months ago

你的cookie设置了Domain吗?源码中设置了Domain会有问题