Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7f1e86f

Browse files
authored
Update API for SameSitemode (dotnet#3569)
* Update API for SameSitemode On framework systems, the behavior of SameSiteMode.None has changed. This PR documents the new behavior, and links to the KB articles. * Update xml/System.Web/SameSiteMode.xml Co-Authored-By: Chris Ross <[email protected]> * respond to feedback. * update per review. * Update default description. * missing an opening bracket. * Apply suggestions from code review Co-Authored-By: Scott Addie <[email protected]> * Update xml/System.Web/SameSiteMode.xml Co-Authored-By: Genevieve Warren <[email protected]> * Update xml/System.Web/SameSiteMode.xml Co-Authored-By: Chris Ross <[email protected]> * respond to feedback. * final proofread updates.
1 parent a70f832 commit 7f1e86f

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
lines changed

xml/System.Web/HttpCookie.xml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,18 @@ The <xref:System.Web.HttpCookie.Path%2A> property extends the <xref:System.Web.H
404404
</ReturnValue>
405405
<Docs>
406406
<summary>Gets or sets the value for the SameSite attribute of the cookie.</summary>
407-
<value>One of the enumeration values that represents the enforcement mode of the cookie. If the application targets the .NET Framework 4.7.2 or later versions, the default value is <see cref="F:System.Web.SameSiteMode.Lax" />; otherwise, the default value is <see cref="F:System.Web.SameSiteMode.None" />.</value>
408-
<remarks>To be added.</remarks>
407+
<value>One of the enumeration values that represents the enforcement mode of the cookie or `(SameSiteMode)(-1)` (represented by the string `Unspecified` in config files). The default value depends on updates. For more information on defaults and recent updates, see Remarks.</value>
408+
<remarks><format type="text/markdown"><![CDATA[
409+
410+
## Remarks
411+
412+
The default value of this property was modifed by updates described in [KB article 4531182](https://support.microsoft.com/help/4531182/kb4531182) and [KB article 4524421](https://support.microsoft.com/help/4524421/kb4524421).
413+
414+
Without these updates, the default value is <see cref="F:System.Web.SameSiteMode.None" />, which does not emit the `SameSite` cookie header. This conforms to [https://tools.ietf.org/html/draft-west-first-party-cookies-07#section-4.1](https://tools.ietf.org/html/draft-west-first-party-cookies-07#section-4.1).
415+
416+
After these updates have been applied, the default value is `(SameSiteMode)(-1)`, which corresponds to `Unspecified`. This preserves the earlier behavior. Setting `SameSiteMode.None` causes "SameSite=None" to be emitted. This new behavior conforms to [https://tools.ietf.org/html/draft-west-cookie-incrementalism-00](https://tools.ietf.org/html/draft-west-cookie-incrementalism-00).
417+
]]></format>
418+
</remarks>
409419
</Docs>
410420
</Member>
411421
<Member MemberName="Secure">

xml/System.Web/SameSiteMode.xml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,20 @@
1414
</Base>
1515
<Docs>
1616
<summary>Specifies constants that indicate the value for the SameSite attribute of the cookie.</summary>
17-
<remarks>To be added.</remarks>
17+
<remarks>
18+
<format type="text/markdown"><![CDATA[
19+
20+
## Remarks
21+
22+
The behavior of <see cref="F:System.Web.SameSiteMode.None" /> was modified by updates described in [KB article 4531182](https://support.microsoft.com/help/4531182/kb4531182) and [KB article 4524421](https://support.microsoft.com/help/4524421/kb4524421).
23+
24+
Without these updates, the <see cref="F:System.Web.SameSiteMode.None" /> value does not emit the `SameSite` cookie header. This conforms to [https://tools.ietf.org/html/draft-west-first-party-cookies-07#section-4.1](https://tools.ietf.org/html/draft-west-first-party-cookies-07#section-4.1).
25+
26+
After these updates have been applied, the <see cref="F:System.Web.SameSiteMode.None" /> value emits the `SameSite=None` cookie header. This new behavior conforms to [https://tools.ietf.org/html/draft-west-cookie-incrementalism-00](https://tools.ietf.org/html/draft-west-cookie-incrementalism-00). As part of this change, FormsAuth and SessionState cookies will be issued with SameSite = `Lax` instead of the previous default of `None`, though these values can be overridden in web.config.
27+
28+
On systems where these updates have been applied, you can specify the previous behavior by setting the `SameSiteMode` to `(SameSiteMode)(-1)`. You can specify this behavior using the string `Unspecified` in web.config.
29+
]]></format>
30+
</remarks>
1831
</Docs>
1932
<Members>
2033
<Member MemberName="Lax">
@@ -54,7 +67,7 @@
5467
</ReturnValue>
5568
<MemberValue>0</MemberValue>
5669
<Docs>
57-
<summary>No mode is specified.</summary>
70+
<summary>The cookie will be sent with all requests (see remarks).</summary>
5871
</Docs>
5972
</Member>
6073
<Member MemberName="Strict">
@@ -74,7 +87,7 @@
7487
</ReturnValue>
7588
<MemberValue>2</MemberValue>
7689
<Docs>
77-
<summary>When the value is Strict, or if the value is invalid, the cookie will only be sent along with "same-site" requests.</summary>
90+
<summary>When the value is Strict the cookie will only be sent along with "same-site" requests.</summary>
7891
</Docs>
7992
</Member>
8093
</Members>

0 commit comments

Comments
 (0)