Page 1 of 1

maximum size of cookie content

Posted: Mon Feb 20, 2006 9:30 am
by jasongr
Hi people

I was wondering if anyone knows whether there is a maximum size limit on a cookie content

If so,
1) Is this a limit per cookie in a single domain? i.e. no single cookie value can exceed XX bytes
2) Is this a limit on all the cookies that get saved under a single domain? i.e. the total size of all the cookies cannot exceed XX bytes
3) Is the limit different from browser to browser?
4) How can I detect what the limit is?

regards

Posted: Mon Feb 20, 2006 9:40 am
by Maugrim_The_Reaper
No idea personally but a few sites carry the following rules of thumb:

http://www.devx.com/tips/Tip/12646

Based on that seems to be a limit (in general) of about 4098 bytes (4KB), and 20 cookies per domain per client. If you are running into cookie difficulties it may pay to use SESSIONs in PHP.