Evgeniy Miroshnichenko
Evgeniy Miroshnichenko

Reputation: 1865

Will browsers throw some Error if cookie size will be out of browser limit?

If cookie size is out of browser limit Will browsers throws some Error?

Upvotes: 5

Views: 685

Answers (1)

Ankit
Ankit

Reputation: 6153

The browser just crashes !

Webpage becomes un-responsive and finally browser crashes, you can try this yourself :

  1. Go to this website
  2. Try setting a cookie with a very large size (a character repeated n number of times )
  3. See for yourself

Highlights of the article shared above :

If you want to support most browsers, then don't exceed 50 cookies per domain, and don't exceed 4093 bytes per domain (i.e. total size of all cookies <= 4093 bytes)

Typically, the following are allowed:

  • 300 cookies in total
  • 4096 bytes per cookie
  • 20 cookies per domain
  • 81920 bytes per domain*

*Given 20 cookies of max size 4096 = 81920 bytes.

Upvotes: 2

Related Questions