Odd & Sporadic Chrome Error: The chunked cookie is incomplete

Viewed 1681

We have a .NET Framework 4.7 Azure hosted web app that has been running smoothly now for a long time. We've told all of our users that they should be using Chrome, and as far as we know, most do.

A few weeks ago, a user reported an odd server-side error. The on-screen message wasn't very helpful, so we turned off Custom Errors. That seemed to help us get the actual error message:

The chunked cookie is incomplete. Only 0 of the expected chunks were found, totaling 0 characters. A client size limit may have been exceeded.

We had never seen that error before, but a quick search offered a solution. We asked the user to clear cookies and try again. That worked. Then a few days later, two more users reported the exact same error. Then more. And then more. The initial fix worked for some, but not others. Eventually, we came up with the following steps:


  1. Log out of all of our applications. Close all Chrome tabs and windows. Open a new Chrome window.
  2. Clear browser data
    a. Click on the three dots in the upper right corner
    b. Select “More Tools > Clear Browser Data”
    c. Probably best to select “All Time” but the user may try a shorter time frame at first
  3. Reset Chrome to default settings
    a. Instructions: https://support.google.com/chrome/answer/3296214?hl=en
  4. Close all Chrome tabs and windows and try again.

IF it still does not work, then follow these steps…

  1. Log out of all of our applications. Close all Chrome tabs and windows. Open a new Chrome window.
  2. In the URL bar, copy and paste this address: chrome://flags
  3. In the search bar, type: samesite
  4. Your window should now look like this: enter image description here
  5. For all three options, change the dropdown from Default to Enabled
  6. Click the “RELAUNCH” button in the lower right.
  7. After Chrome re-launches, go back to the app as you normally would.
    a. You should now have access.
    b. However, we’re not done yet!
  8. Repeat 1-5 above, and this time reset all three options back to Default.
    a. Then again click the “RELAUNCH” button.

IF it still does not work, then follow these steps…

  1. Try to access our application via Microsoft Edge

(We stopped asking users to try in an incognito window because so many of their offices restrict its usage.)

In the meantime, we are working like mad to try and identify the actual cause of the error. Surprisingly, there isn't much chatter about this one. It seems to be related to a recent update in how Chrome handles same-site cookies, but the main issue is... we can't reproduce it. It seems to be popping up at random. And some users report the error going away w/o them doing anything.

And, then, of course... we have one single user for whom NONE of the steps above work. Not even using Edge. So far, the steps above have worked for everyone BUT him.

Has ANYONE run into something like this before? Any ideas? Suggestions?

1 Answers

For any who may run into this error, here's how we eventually solved it. At this point, I am going off long-term memory so I will try and be as accurate as possible.

The problem was due to putting too much data into a cookie. In our case, the cookie was being used as a validation token.

The reason the error just started happening seemingly at random was that some browsers (ie: chrome) included a cookie length limit in an update. So when a user's browser version was updated, they would start seeing the error.

We had to first figure out which cookie was causing the error. That wasn't hard because most had very short values. Once we knew which cookie was the issue, we then just figured out how to substantially reduce the amount of data being written to it.

Related