Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SameSite cookie support #82

Merged
merged 2 commits into from Jun 25, 2020
Merged

Conversation

nanasess
Copy link
Collaborator

@nanasess nanasess commented Apr 23, 2020

概要(Overview・Refs Issue)

方針(Policy)

  • SameSite=None に対応する
  • iOS12 など、非対応の UA は除外する
  • PHP7.3 での setcookie() 関数の変更に対応する
  • secure 属性を付与するため、管理画面の SSL強制を ON にする必要がある
    • OFF の場合は、 SameSite 属性は付与されない

実装に関する補足(Appendix)

  • Silex のセッション関連のパラメータは ini_set() 経由で設定されているため、 session.cookie_path を動的に設定することで対応
  • 3系の過去バージョンも、 Application::initSession() へ同様の修正を追加することで対応可能
  • 4系で使用している skorp/detect-incompatible-samesite-useragents は、PHP7.0 以降の対応なので、 SameSite cookie Hotfix パッチ と同じ除外パターンを使用している

テスト(Test)

ユニットテストを追加

相談(Discussion)

  • RememberMe も対応するためには、 Symfony\Component\HttpFoundation\Response の修正が必要になるため、現状対応していない

@nanasess nanasess force-pushed the samesite-none-compat branch 3 times, most recently from 9e2da13 to d02da82 Compare April 24, 2020 03:09
@nanasess nanasess force-pushed the samesite-none-compat branch 6 times, most recently from 74998bf to 33f339e Compare April 24, 2020 08:53
@ryo-endo ryo-endo added this to the patch-SameSite milestone May 22, 2020
@ryo-endo
Copy link
Contributor

ありがとうございます。
こちらパッチとして提供予定です。

@chihiro-adachi
Copy link
Contributor

cookie の発行状況

以下cookieが正しく発行されていることを確認しました。

force ssl php ver secure samesite
force ssl off php 7.0.3未満 - -
force ssl off php 7.0.3以上 - -
force ssl on php 7.0.3未満 on on
force ssl on php 7.0.3以上 on on

safariについてはMac safari 13.1.1 (15609.2.9.1.2) にて、samesiteが発行されていないことを確認

決済プラグイン

EC-CUBEペイメントにて、クレジットカード(3Dセキュア)、楽天Payで購入完了できることを確認しています。

@chihiro-adachi chihiro-adachi added the enhancement New feature or request/機能追加 label Jun 25, 2020
@chihiro-adachi chihiro-adachi merged commit 72eb21a into EC-CUBE:3.0 Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request/機能追加
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants