## **cookies**
微信小程序請求無法傳遞cookies字段,在二次封裝請求中已經給微信小程序兼容了cookies
```javascript
// #ifdef MP-WEIXIN
headerConfig['cookie'] = uni.getStorageSync('SESSION')
// #endif
```
所以只需要在登錄的時候把cookies從請求中取出來放到storageSync里(
微信小程序可以獲取到requestOnly的cookies )
```
/*設置cookies*/
let str = '';
let arr = loginResult['header']['Set-Cookie'].split(',');
/*處理cookies*/
arr.forEach(item=>{
if(item.match('rememberMeTest=deleteMe')) return;
if(item.match('rememberMeTest') || item.match('SESSION')){
str += item;
str += ';';
}
/*存儲cookies*/
uni.setStorageSync('SESSION', str)
```