This repository has been archived by the owner on Jan 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SameSite support for NancyCookies
SameSite property will accept Lax, Strict and None values. Fix #3002
- Loading branch information
Ali Bahrami
committed
Mar 10, 2020
1 parent
11ac0fe
commit 60e7596
Showing
4 changed files
with
63 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
namespace Nancy.Cookies | ||
{ | ||
/// <summary> | ||
/// Represents the SameSite for NancyCookie | ||
/// </summary> | ||
public enum SameSite | ||
{ | ||
/// <summary> | ||
/// If the value is invalid, the cookie will only be sent along with | ||
/// "same-site" requests. If the value is "Lax", the cookie will be | ||
/// sent with "same-site" requests, and with "cross-site" top-level navigations | ||
/// </summary> | ||
Lax = 0, | ||
|
||
/// <summary> | ||
/// If you set SameSite to Strict, your cookie will only be sent in a | ||
/// first-party context. In user terms, the cookie will only be sent | ||
/// if the site for the cookie matches the site currently shown in | ||
/// the browser's URL bar. | ||
/// </summary> | ||
Strict, | ||
|
||
/// <summary> | ||
/// Cookies with SameSite=None must also specify Secure, | ||
/// meaning they require a secure context. | ||
/// </summary> | ||
None | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters