anchor.diff:           {valid_http_request(), cookie_max_age(), valid_http_response()},
            begin
                ResponseBin = build_response(Response, [Cookie]),
  -             ValidationFun = validate_cookie_max_age(ResponseBin, Expires, Cookie),
  -             WaitTime = case Expires of
  -                            true ->
  -                                MaxAge*1000;
  -                            false ->
  -                                0
  -                        end,
  -             [FirstResponse, SecondResponse] =
  -                 send_cookie_requests(Host, Ssl, Family, ValidationFun, Path, Request,
  -                                      [<<"first">>, <<"second">>], WaitTime),
  -             Expected = {Status, Reason},
  -             ?WHENFAIL(io:format("FirstResponse: ~p~nExpected:"
  -                                 " ~p~nSecondResponse ~p~n",
  -                                 [FirstResponse, Expected, SecondResponse]),
  -                       (FirstResponse == Expected)
  -                       and (SecondResponse == {<<"200">>, <<"OK">>})
  -                      )
  +             ValidationFun = validate_cookie(ResponseBin, fun check_cookie_max_age/3,
  +                                             [Expires, Cookie]),
  +             WaitTime = expiration_time(Expires, MaxAge),
  +             Responses =
  +                 send_cookie_requests(Host, Ssl, Family, ValidationFun, Path,
  +                                      Request, [<<"first">>, <<"second">>],
  +                                      WaitTime),
  +             check_responses(Status, Reason, Responses)
            end
           )
        ).
  -
   %%==============================================================================
   %% Internal functions
   %%==============================================================================
  
positive.code:        {valid_http_request(), cookie_path(), valid_http_response()},
         begin
             ResponseBin = build_response(Response, [Cookie]),
             ValidationFun = validate_cookie_path_msg(ResponseBin, IsSubPath, Cookie),
             [FirstResponse, SecondResponse] =
                 send_cookie_requests(Host, Ssl, Family, ValidationFun, Path, Request,
                                      [<<"first">>, <<"second">>], 0),
             Expected = {Status, Reason},
             ?WHENFAIL(io:format("FirstResponse: ~p~nExpected:"
                                 " ~p~nSecondResponse ~p~n",
                                 [FirstResponse, Expected, SecondResponse]),
                       (FirstResponse == Expected)
                       and (SecondResponse == {<<"200">>, <<"OK">>})
                      )
         end
        ).
  
  
negative.code:               %% First get cookie
                %% Second get second cookie
                %% Third checks received cookies
                Responses =
                    send_cookie_requests(Host, Ssl, Family, ValidationFun,
                                         encode_path(Path), Request,
                                         [<<"first">>, <<"second">>, <<"third">>], 0),
                check_responses(Status, Reason, Responses)
            end
           )
        ).
  