Added method to pass cookies on conenct

thanks to hongkongkiwi from hongkongkiwi@e0e4f62