Răsfoiți Sursa

* Restore cookies when reconnecting. Fix issue #40813

Michaël Van Canneyt 8 ore în urmă
părinte
comite
019cf17a69
1 a modificat fișierele cu 8 adăugiri și 0 ștergeri
  1. 8 0
      packages/fcl-web/src/base/fphttpclient.pp

+ 8 - 0
packages/fcl-web/src/base/fphttpclient.pp

@@ -1647,7 +1647,15 @@ begin
       if (FKeepConnectionReconnectLimit>=0) and (ACount>=KeepConnectionReconnectLimit) then
         break; // reconnect limit is reached -> exit
       If Not SkipReconnect and Not Terminated Then
+        begin
+        // Restore request cookies before retry (bug #40813): (similar to redirect)
+        if (not Assigned(FCookies)) and Assigned(FSentCookies) then
+          begin
+          FCookies:=FSentCookies;
+          FSentCookies:=Nil;
+          end;
         ReconnectToServer(CHost,CPort,AIsHttps);
+        end;
       Inc(ACount);
     Finally
       // On terminate, we close the request