Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 402
Evgeniy Miroshnichenko Avatar asked Oct 29 '22 03:10

Evgeniy Miroshnichenko


1 Answers

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.

like image 69
Ankit Avatar answered Nov 15 '22 04:11

Ankit