added cookies support.

the implementation isn't ok yet, because the response headers are
represented as a hash table, but some headers (e.g. Set-Cookie) are
ususlly sent more than once.