If you are running into an issue when your chrome driver crashes while setting a cookie during your test, it might be due to a bug in the chromedriver_version 88 and 89.
You will most likely see a pop up with a message:
chrimedriver.exe has stopped working
A problem has caused the program to stop working correctly.
Windows will close the problem and notify you if solution is available.
We would like to save you some time by sharing what we have found.
If you set a cookie with a value that has a space at the end, ChromeDriver will crash. This bug could be reproduced on Sauce Labs as well as locally.
It might go away, but for right now, this bug is alive and well, and we would like you to know about it. So to avoid a headache, make sure that there are no spaces after the cookie value.