Added method to pass cookies on conenct

Added in a connection method to pass cookie values which can then be read in the server.

This has the advantage of not having to pass things like passwords over plain text to the server.