/    Sign up×
Community /Pin to ProfileBookmark

maximum size of cookie content

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 [b]all[/b] 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

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@bokehFeb 20.2006 — With Firefox and Opera you are talking 4092 and 4091 string length respectively, IE is more. Apache errors out on about 6kB of cookie and will not serve the request at all.
Copy linkTweet thisAlerts:
@felgallFeb 20.2006 — Your best solution if you need more than 4k would be to use sessions and just save an identifier in the cookie. Sessions allow for a lot more information than cookies do they just don't allow you to save anything between browser sessions so you will need to save the session data in a file or database and use the cookie to identify which data to retrieve to set up the session for the next visit.
×

Success!

Help @jasongr spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...