This is a patch to use cookies in order to allow
session state with servers that support it.
It stores the cookies in a static variable in the
URLConnectionFactory, so the cookies will be able
available to all the requests in the same process using
URL as a connection method, I haven't applied it to
SocketConnectionFactory.
I even included some untested code, which is suposed to
read the browser's cookies and use them.
Patch file