About CookieContainer Specifications

Asked 2 years ago, Updated 2 years ago, 44 views

How do I escape separators (semi-colon and commas) when I add cookies to CookieContainer?

I found an alternative way to encode percentage and replace space, but I wanted to know how to set the separator to a value as the original specification.

Thank you for your cooperation.

c# .net

2022-09-30 18:05

1 Answers

As a specification for the System.Net.Cookie class, you can include control characters by adding double quotes at both ends of the value, such as new cookie("name", "\"abc,def\"").

This behavior is defined in RFC2965 as the HTTP specification, but the newer RFC6265 cannot contain control characters, so you need to see how the server behaves in the end.


2022-09-30 18:05

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.