ESP8266WebServer cookie save problem

How can that be a typo?

Your string cookieHeader contains "Set-Cookie: ....." and then the .sendHeader() call uses the header "Set-Cookie" and the value is your cookieHeader String?