CookieException with external Callback

I am using SS for handling callback url of Mailgun. I can see in the logs that there are some issues with the cookies, most probably because the webhook is sending these. This is what I see:

System.Net.CookieException: The 'Name'='$Path' part of the cookie is invalid. at System.Net.Cookie.set_Name(String value) at System.Net.Cookie..ctor(String name, String value) at ServiceStack.Host.NetCore.NetCoreRequest.get_Cookies()

System.Net.CookieException: The 'Name'='$Version' part of the cookie is invalid. at System.Net.Cookie.set_Name(String value) at System.Net.Cookie..ctor(String name, String value) at ServiceStack.Host.NetCore.NetCoreRequest.get_Cookies()

Is there a way to ignore this? I am using SeriLog as a logger, and these exceptions are in my logs now.

I’ve added a commit which will strip the $ prefix on Cookie Names to prevent runtime Exceptions.

This change is available from v5.0.3 that’s now available on MyGet.

1 Like