Added cookie code to be able to log in. All the major pieces should
be there, but we still do not get the correct HTTP responses. Requires
more debugging