Fix cookie handling and return args of the authenticate hook for to work
in Roundcube 1.0.