EIdCookieError exceptions

Giganews Newsgroups
Subject: EIdCookieError exceptions
Posted by:  Clayton Arends (nospam_claytonarends@hotmail.com)
Date: Thu, 7 Oct 2010

My Indy source tree is on the version as of Sep 10, 2010.  One of my
projects was recently compiled against it and now every HTTP request raises
the following exception:

  (EIdCookieError)
  Unsupported cookie version: 0

I used the following test application to replicate the problem.

- Create a new VCL Forms Application (I used Delphi)
- Drop a TIdHTTPServer component on the form
- Set the server active in code
- Run the app, connect via a browser

The exception happens whether or not I have an OnCommandGet handler.

I upgraded to today's snapshot (Oct 07) and the error is the same.  Is this
a known issue?  Is there something that I need to do to make this work?  I
took a look at IdCookie.pas and there was a lot of work done to it between
my previous working source branch (May 12) and Sep 10 when I started having
the problem.  The method that is throwing the exception is:

  procedure TIdCookieRFC2965.SetVersion(const AValue: Integer);
  begin
    if AValue <> 1 then
    begin
      raise EIdCookieError.CreateFmt(RSHTTPUnknownCookieVersion, [AValue]);
    end;
    FVersion := AValue;
  end;

The old (working) code used to be:

  procedure TIdCookieRFC2965.SetVersion(const AValue: Integer);
  begin
    if AValue >= 1 then begin
      FVersion := AValue;
    end else begin
      FVersion := 1;
    end;
  end;

I am going to change this method back to what it used to be and see if that
works (when I have time later tonight).  Please advise if there is a better
solution.

Thank you,

Clayton

Replies