Browse Source

* Fix for bug #33451: Set-Cookie only keeps last cookie, patch by engkin

git-svn-id: trunk@38565 -
michael 7 years ago
parent
commit
b86cd03403
1 changed files with 2 additions and 2 deletions
  1. 2 2
      packages/fcl-web/src/base/fphttpclient.pp

+ 2 - 2
packages/fcl-web/src/base/fphttpclient.pp

@@ -816,8 +816,6 @@ function TFPCustomHTTPClient.ReadResponseHeaders: integer;
     C : String;
     C : String;
 
 
   begin
   begin
-    If Assigned(FCookies) then
-      FCookies.Clear;
     P:=Pos(':',S);
     P:=Pos(':',S);
     System.Delete(S,1,P);
     System.Delete(S,1,P);
     Repeat
     Repeat
@@ -837,6 +835,8 @@ Var
   StatusLine,S : String;
   StatusLine,S : String;
 
 
 begin
 begin
+  If Assigned(FCookies) then
+    FCookies.Clear;
   if not ReadString(StatusLine) then
   if not ReadString(StatusLine) then
     Exit(0);
     Exit(0);
   Result:=ParseStatusLine(StatusLine);
   Result:=ParseStatusLine(StatusLine);