|
@@ -97,6 +97,7 @@ const
|
|
SCookiePath = httpProtocol.SCookiePath;
|
|
SCookiePath = httpProtocol.SCookiePath;
|
|
SCookieSecure = httpProtocol.SCookieSecure;
|
|
SCookieSecure = httpProtocol.SCookieSecure;
|
|
SCookieHttpOnly = httpProtocol.SCookieHttpOnly;
|
|
SCookieHttpOnly = httpProtocol.SCookieHttpOnly;
|
|
|
|
+ SCookieSameSite = httpProtocol.SCookieSameSite;
|
|
|
|
|
|
HTTPMonths : array[1..12] of string[3] = (
|
|
HTTPMonths : array[1..12] of string[3] = (
|
|
'Jan', 'Feb', 'Mar', 'Apr',
|
|
'Jan', 'Feb', 'Mar', 'Apr',
|
|
@@ -148,11 +149,13 @@ type
|
|
TRequest = Class;
|
|
TRequest = Class;
|
|
|
|
|
|
{ TCookie }
|
|
{ TCookie }
|
|
|
|
+ TSameSite = (ssEmpty,ssNone,ssStrict,ssLax);
|
|
|
|
|
|
TCookie = class(TCollectionItem)
|
|
TCookie = class(TCollectionItem)
|
|
private
|
|
private
|
|
FHttpOnly: Boolean;
|
|
FHttpOnly: Boolean;
|
|
FName: string;
|
|
FName: string;
|
|
|
|
+ FSameSite: TSameSite;
|
|
FValue: string;
|
|
FValue: string;
|
|
FPath: string;
|
|
FPath: string;
|
|
FDomain: string;
|
|
FDomain: string;
|
|
@@ -171,6 +174,7 @@ type
|
|
property Expires: TDateTime read FExpires write FExpires;
|
|
property Expires: TDateTime read FExpires write FExpires;
|
|
property Secure: Boolean read FSecure write FSecure;
|
|
property Secure: Boolean read FSecure write FSecure;
|
|
property HttpOnly: Boolean read FHttpOnly write FHttpOnly;
|
|
property HttpOnly: Boolean read FHttpOnly write FHttpOnly;
|
|
|
|
+ property SameSite: TSameSite Read FSameSite Write FSameSite;
|
|
Property AsString : String Read GetAsString;
|
|
Property AsString : String Read GetAsString;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -2317,6 +2321,10 @@ function TCookie.GetAsString: string;
|
|
Result:=Result+';'+S;
|
|
Result:=Result+';'+S;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+Const
|
|
|
|
+ SSameSiteValues : Array[TSameSite] of string
|
|
|
|
+ = ('','None','Strict','Lax');
|
|
|
|
+
|
|
Var
|
|
Var
|
|
Y,M,D : Word;
|
|
Y,M,D : Word;
|
|
|
|
|
|
@@ -2338,6 +2346,8 @@ begin
|
|
AddToResult(SCookieHttpOnly);
|
|
AddToResult(SCookieHttpOnly);
|
|
if FSecure then
|
|
if FSecure then
|
|
AddToResult(SCookieSecure);
|
|
AddToResult(SCookieSecure);
|
|
|
|
+ if FSameSite<>ssEmpty then
|
|
|
|
+ AddToResult(SSameSiteValues[FSameSite]);
|
|
except
|
|
except
|
|
{$ifdef cgidebug}
|
|
{$ifdef cgidebug}
|
|
On E : Exception do
|
|
On E : Exception do
|