
根據官方 Chrome 這兩則 [Cookies default to SameSite=Lax](https://www.chromestatus.com/feature/5088147346030592) 和 [Reject insecure SameSite=None cookies](https://www.chromestatus.com/feature/5633521622188032) 公告,若你的 Set-Cookie 裡的 SameSite 值為 None 或是 Lax(若是Get為例外)或是根本沒有 SameSite 屬性時,你的 Set-Cookie 裡必須還要含有 Secure 值才會讓此次要求(Request)裡的 Cookies 成功送出,以下為兩張比較圖
走 http 時 Set-Cookie 裡並不會加上 Secure

走 https 時 Set-Cookie 裡會自動加上 Secure

但以我是網站開發者的角度來說,這樣的規範其實有些時候會造成開發上的困擾,基本上我們並不會把每個測試網站都特別去申請一個 SSL 憑證來掛,因此這邊提供了一個較簡易的 Workaround 處理方式,如下 1\. 在 Chrome 網址列輸入 `chrome://flags` 後確定 2\. 輸入 **Cookies** 或 **Cookies without SameSite must be secure** 並搜尋  3\. 將 ***Cookies without SameSite must be secure*** 設定改為 **Disabled**  ##***重要(2021.10.14 更新):*** Chrome 在 **91** 版以後已將此 flag 移除(**94** 版後也不再支援使用引數方式),所以該 Workaround 也不適用了,詳細資訊可參考[這裡](https://piunikaweb.com/2021/06/14/google-chrome-flags-for-samesite-cookies-taken-away-after-update-v91/)。
##參考資料 [\[Google Chrome Help\] How can I get around this cookies getting blocked during development](https://support.google.com/chrome/thread/34237768?hl=en)
但以我是網站開發者的角度來說,這樣的規範其實有些時候會造成開發上的困擾,基本上我們並不會把每個測試網站都特別去申請一個 SSL 憑證來掛,因此這邊提供了一個較簡易的 Workaround 處理方式,如下 1\. 在 Chrome 網址列輸入 `chrome://flags` 後確定 2\. 輸入 **Cookies** 或 **Cookies without SameSite must be secure** 並搜尋  3\. 將 ***Cookies without SameSite must be secure*** 設定改為 **Disabled**  ##***重要(2021.10.14 更新):*** Chrome 在 **91** 版以後已將此 flag 移除(**94** 版後也不再支援使用引數方式),所以該 Workaround 也不適用了,詳細資訊可參考[這裡](https://piunikaweb.com/2021/06/14/google-chrome-flags-for-samesite-cookies-taken-away-after-update-v91/)。
##參考資料 [\[Google Chrome Help\] How can I get around this cookies getting blocked during development](https://support.google.com/chrome/thread/34237768?hl=en)