Secure Cookie Attributes
セキュアクッキー属性
セキュアクッキー属性は、クッキーの移動方法やスクリプトがそれを読み取れるかどうかを制御します。また、クロスサイトでの使用、どのホストおよびパスが受け取るか、そして有効期間も制御します。
もう一つの例
レスポンスは `__Host-session` を `Secure; HttpOnly; SameSite=Lax; Path=/` で設定し、`Domain` を指定せずにサインイン後に変更します。第三者の支払いの戻りは、独自の制限付き相関クッキーを使用します。それはすべてのセッションクッキーを弱めるわけではありません。サインアウトすると、サーバーセッションも終了します。
主な部分
- 01名前の接頭辞と値
- 02トランスポート/スクリプト/サイト制限
- 03スコープと寿命
以下の場合に使用します
クッキーには、最小限の有用な範囲と寿命を与えます。セッションクッキーは通常、`Secure`、`HttpOnly`、選択した`SameSite`モード、およびホストプレフィックスを使用する必要があります。
以下の場合は使用しないでください
`Path` はセキュリティの壁ではありません。必要なしに広い `Domain` を設定したり、スクリプトで読めるクッキーにベアラーシークレットを入れたりしないでください。`SameSite=None` を `Secure` なしで使用することは絶対に避けてください。
コードで使用する名前
Set-Cookie: __Host-name=…; Secure; HttpOnly; SameSite=Lax/Strict; Path=/; Max-Age=… 出荷前に
Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback.
Outcome:Complete the task with セキュアクッキー属性 (Secure Cookie Attributes)。 User context:レスポンスは `__Host-session` を `Secure; HttpOnly; SameSite=Lax; Path=/` で設定し、`Domain` を指定せずにサインイン後に変更します。第三者の支払いの戻りは、独自の制限付き相関クッキーを使用します。それはすべてのセッションクッキーを弱めるわけではありません。サインアウトすると、サーバーセッションも終了します。 Technical concept or control:セキュアクッキー属性 (Secure Cookie Attributes)。 Why it fits:クッキーには、最小限の有用な範囲と寿命を与えます。セッションクッキーは通常、`Secure`、`HttpOnly`、選択した`SameSite`モード、およびホストプレフィックスを使用する必要があります。 Do not use it when:`Path` はセキュリティの壁ではありません。必要なしに広い `Domain` を設定したり、スクリプトで読めるクッキーにベアラーシークレットを入れたりしないでください。`SameSite=None` を `Secure` なしで使用することは絶対に避けてください。 Engineering requirements: Define inputs, outputs, contracts, and rules that must always hold. Set authorization and input checks. Define failures, timeouts, retries, one-time effects, data moves, and compatibility limits. Operations: Add useful signals and logs that hide sensitive data. Set capacity limits and write an operator guide. Test recovery and rollback. Acceptance criteria: Contract and failure-path tests pass. Data and authorization rules still hold during retries and partial failures. Check performance limits, monitoring, recovery, and rollback. Evidence and limits (evidence boundary):きちんとした書類でも、まだドラフトやリリース候補、あるいは最終版かもしれません。ステータスや、ブラウザやプラットフォームの対応状況を確認しましょう。 Unknowns to confirm: Where the code runs, data stores, traffic shape, consistency needs, and the security boundary. Also confirm the compatibility period, service goals, and rollback limits.
このリクエストを確認する
Review how セキュアクッキー属性 (Secure Cookie Attributes) is used now. Definition: セキュアクッキー属性は、クッキーの移動方法やスクリプトがそれを読み取れるかどうかを制御します。また、クロスサイトでの使用、どのホストおよびパスが受け取るか、そして有効期間も制御します。 Release checks: Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.