Troubleshooting Exceptions: System.Net.CookieException
A CookieException exception is thrown when an error is made adding a cookie to a cookie container.
The Name property must be initialized before using an instance of the Cookie class. The following characters are reserved and cannot be used for this attribute value: equal sign, semicolon, comma, new line (\n), carriage return (\r), tab (\t). The dollar sign ($) character cannot be the first character.
The Port attribute restricts the ports to which a cookie may be sent. The default value means no restriction. Setting the property to an empty string ("") restricts the port to the one used in the HTTP response. Otherwise the value must be a string in quotation marks that contains port values delineated with commas.
The following characters are reserved and cannot be used for this property: semicolon, comma.