Fixes

Easily Fix Bad Request: Request Header or Cookie too Large Issue

If you are getting the Error 400 Bad Request: Request Header or Cookie too Large Issue issue while trying to access a website or even your own website, we are here to help you. In this article, we have compiled different solutions and workarounds that will help you completely rid yourself of this error.

Bad Request Header or Cookie too Large Error
Bad Request Header or Cookie too Large Error

Make sure to follow all the solutions that have been listed in this article and also read through the reasons due to which it occurs in the first place. Basically, some Nginx web servers are set up in such a way that they might not accept cookies that are greater than a certain size.

What Causes the 400 Bad Request Request Header or Cookie too Large Error?

After going through the mentioned solutions that the users have told us, we have concluded the reasons due to which the error might be triggered.

  • Large Cookies: Sometimes, the cookies that you are trying to use with the website might be too large due to which the Bad Request Header or Cookie too large error might be triggered. Therefore, we suggest that you try and clear out the cookies in an attempt to fix the issue.
  • DNS Cache: The DNS settings that you have configured with your computer might be preventing it from being able to connect with certain websites or the DNS cache stored might have been corrupted. Therefore, we suggest that you try and flush out the DNS cache.
  • File Size: The File  Size that you are trying to upload might be larger than the upload limit of the website. Therefore, we suggest that you try and reduce the file size or try to upload a different file with a size smaller than the one that you are trying to upload.
  • Chrome Extensions: The extensions installed on your browser might be preventing the site from being accessed due to which the error is being triggered. Therefore, we suggest that you try and disable the extensions and then check to see if doing so fixes the error message.

Now that the reasons have been mentioned to you, you can finally start implementing the solutions and hopefully get rid of the error message on your PC.

Fixing the Bad Request Header or Cookie too Large Error:

Solution 1: Clear Cookies

This error can be instantly resolved by clearing cookies from your browser. Proceed with the steps listed below for clearing the cache in your respective browser:

Google Chrome:

  1. Launch Google Chrome and select the “Three Dots” on the top right side of the window.
  2. From the dropdown menu that appears, click on the “Settings” option.
  3. In the search bar type in “Site Settings” and open it.
    Clicking on "Site Settings"
    Clicking on “Site Settings”
  4. Navigate to “Content” and click on “Cookies and Site Data”.
  5. Afterwards, click on the “See all cookies and sites” option.
  6. Then click on “Remove All” to remove all of the cookies.
    Clicking on the "Remove All" button to fix Request Header or Cookie too Large error
    Clicking on the “Remove All” button
  7. Finally, proceed to “Restart” the Chrome browser.

Firefox:

  1. Open Firefox on your desktop PC and click on the “Open Application Menu” option in the top-right corner.
  2. From here select “Options” from the drop-down menu and next click on “Privacy & Security” from the right window pane.
    Clicking on "Options" in Firefox
    Clicking on “Options” in Firefox
  3. Next under the “History” section click on the “Clear History” option.
  4. Lastly “Restart” Firefox and check to see if the error got solved.

Microsoft Edge:

  1. Open Microsoft Edge on your PC and click on the “Three Dots” in the upper right corner of the window.
  2. Click on the “Settings” option on the top right side and from the left, select the “Privacy, Search, and Services” option.
  3. On the Right, select the “Choose what to clear” option and select it.
  4. Check the “Cookies and saved website data” option and next click on “Clear”.
    Clearing Microsoft Edge Cookies to fix Bad Request Header or Cookie too Large Error
    Clearing Microsoft Edge Cookies
  5. Lastly, “Restart” the browser and check to see if the error got fixed.

Opera:

  1. Click on the “Opera” icon in the upper left corner of the window.
  2. Select the “Preferences” from the drop-down menu.
  3. Then select “Privacy and Security” and navigate to “Cookies”.
    Clicking on the Privacy and Security option
    Clicking on the Privacy and Security option
  4. Go to “All cookies and website data” and delete all cookies by clicking the “Delete All” option.
  5. Finally, “Restart” the browser.

Safari:

  1. Click on the “Safari” icon on the top left-hand corner of the window.
  2. From the dropdown menu, navigate to “Preferences” and click on it.
  3. Select the “Privacy” tab and click on “Remove all website data” in cookies to delete all cookies.
    Selecting the Remove all Website Data option
    Selecting the Remove all Website Data option
  4. Then “Restart” your browser.

Solution 2: Add Base URL to Clear Cookies

  1. Open “Google Chrome” and click on three vertical dots on the top right corner of the window.
  2. A dropdown menu will appear up, from here click on “Settings”.
  3. In the search bar type “Site Settings” and click to open it.
    Selecting the "Site Settings" option
    Selecting the “Site Settings” option
  4. Click on the “Cookies and Site Data” option and scroll to the bottom.
  5. Click on “Add” which is next to the “Always Clear Cookies when Windows are Closed” option.
    Clicking on the "Add" option
    Clicking on the “Add” option
  6. Enter the base “Web Address”, e.g. youtube.com. (A base address is one that is without any path or an address that leads you to the front page of the website).
  7. Finally, click on “Add”.

Solution 3: Verify the Entered URL

Sometimes the URL you type is also wrong. A few common mistakes are misspelling the site name or entering the backward slashes. One easier way is to use the URL shortener if you have a long URL and try to copy-paste the URL instead of typing it manually to avoid any mistake. Once you have cross-checked your URL, try to access the page again. If you are still getting the error then try other methods like clearing cookies or disabling extensions.

Solution 4: Flush the DNS Cache

  1. Go to the “Start menu” and type “cmd” in the search bar. From the search results right-click on it and select “Run As Administrator”.
    Select Run As Administrator From The Command Prompt
    Select Run As Administrator From The Command Prompt
  2. Then type in the following command in the Command Prompt window and hit the “Enter” key:
    ipconfig /flushdns
    Flush DNS to fix Request Header or Cookie too Large error
    Flush DNS
  3. After executing this command now “Restart” your computer and run Steam again.

Solution 5: Compress the File Size

If you try to upload a file that is larger than the server limit, it is quite likely that you can face this error. You can check this by uploading a smaller file and if it uploads successfully then you might have to compress your file to avoid server limitation issues.

Solution 6: Wait Until the Server Is Being Fixed

This error can also occur due to server-side issues which are out of your control. It might be a server glitch or the server might be being updated. In such a scenario all you can do is to refresh the page and wait till servers are up again. Just refresh the page on a regular interval and check if the server has been fixed and the Header or Cookie too Large error is gone or not.

Solution 7: Disable Chrome Extensions

  1. Launch “Chrome” on your PC, and then click on the “Three vertical dots” in the top right of the window.
  2. From the drop-down menu click to select the “More Tools” option.
    More Tools
    More Tools
  3. Next click to select “Extensions” from the extended menu.
  4. Once inside the Extensions tab “Disable” all of the extensions one by one, if successful in removing the error you can try enabling the extensions one by one afterwards to find out the problematic one.

Solution 8: Change/Add the large_client_header_buffers 4 16k

  1. Add the “large_client_header_buffers 4 16k” directive to the “HTTP” section of “/etc/nginx.conf file”.
  2. Then reload the Nginx process by entering the following command:
sudo nginx -t && sudo service nginx reload
  1. If this doesn’t work then double the value of the second parameter of the “large_client_header_buffers” directive and reload Nginx.
  2. Check to see if doing so fixes the Header or Cookie too Large error.

Solution 9: Use Direct Connection Mode With TCP

Convert the application to use the “Direct connection mode” with the Transmission Control Protocol or TCP. After doing this the issue would not arise because this direct connection mode with the TCP does not have a header size restriction like the HTTP protocol. Use the latest version of SDK that has a fix for query operations when the service interop isn’t available. You can learn more about it in .NET v3 or .NET v2 performance tips articles.

If you can’t go for the direct connection with the TCP then change the client consistency level to lighten the problem. The session token is only used for session consistency, other consistency levels do not use the session token.

Implement the above-indexed methods carefully in order to avoid getting the Header or Cookie too Large error in the future but if you still have any more questions in this regard then feel free to Contact Us here.

Alan Adams

Alan is a hardcore tech enthusiast that lives and breathes tech. When he is not indulged in playing the latest video games, he helps users with technical problems that they might run into. Alan is a Computer Science Graduate with a Masters in Data Science.
Back to top button