Add support for cookie based authentication in the initial handshake

Export the new open function