Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts

    Clarification on cookies

    I just need to check some info here.

    Am I right in assuming that you can saved up to 20 cookies, 4KB each, in one cookie document

  • #2
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Well, not entirely. First of all, those are guidelines (for minimum limits), not even recommendations and certainly not standards. Iew and nn, now also moz, use them dogmatically as absolute limits, however. Second, there is no defined priority order for the other limit, the one about total amount of cookies from all domains. Whether a browser uses that limit to simply not let any more cookies to be written, or whether they throw out the oldest one for that domain, or even maybe the oldest one of them all, or the oldest one from the domain that you have visisted longest ago, is as I understand it undefined and may be either way. It may even decide to clean out all previous cookies when you break that limit. The Netscape cookie spec gives more detail about how they chose to do it.

    But, you are correct for those two browsers, and I doubt other browsers are going to be more restrictive in this perspective.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Not 4KB each - 4KB in total, split among up to 20 cookies.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #4
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Not according to the Netscape cookie spec.
    From <http://wp.netscape.com/newsref/std/cookie_spec.html>:
    There are limitations on the number of cookies that a client can store at any one time. This is a specification of the minimum number of cookies that a client should be prepared to receive and store.

    * 300 total cookies
    * 4 kilobytes per cookie, where the name and the OPAQUE_STRING combine to form the 4 kilobyte limit.
    * 20 cookies per server or domain. (note that completely specified hosts and domains are treated as separate entities and have a 20 cookie limitation for each, not combined)

    Servers should not expect clients to be able to exceed these limits. When the 300 cookie limit or the 20 cookie per server limit is exceeded, clients should delete the least recently used cookie. When a cookie larger than 4 kilobytes is encountered the cookie should be trimmed to fit, but the name should remain intact as long as it is less than 4 kilobytes.
    Note that this spec is not a recommendation, nor is it a standard.
    Last edited by liorean; 01-07-2004 at 11:03 AM.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •