Search code examples
cookieshttp-headershttp-errorhttp-status-code-400

How do deal with a large cookie - HTTP Error 400.


I have just plugged iJento into my project to track marketing data and there is this track method that tracks data entered on a form.

All forms are okay except one rather big form that gives out: HTTP Error 400 - The size of the request headers is too long.

The cookie in the header is indeed pretty big on that form but I don't want to disable it.

I tried enlarging the header size on IIS7. I went to "Request Filtering" and added a new Header of type "Cookie" whose size is a lot larger than it needs to be but that didn't solve it.

Is there another way to circumvent the problem?


Solution

  • Found the answer.

    Going to the registry at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP\Parameters and added two new DWORD (32bit) values MaxFieldLength and MaxRequestBytes

    They need to be set to something larger than the defaults, in my case I used the maximum allowed values which are 65534 and 16777216 in Hexadecimal.

    Then you need to restart he computer and voila.. problem solved.