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 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jan 2006
    Posts
    243
    Thanks
    14
    Thanked 2 Times in 2 Posts

    Bad Request? Cookie limmit exceeded?

    I made a snake browser game with javascript (for learning purposes mostly), which I deemed finished until I was playing around with the level editor just now. I included a level editor that saves levels as a cookie, however when I saved this last level, the list to load levels went blank, and worse, when I refreshed the page I got the following message:

    400 Bad request

    "Your browser sent a request that this server could not understand.
    Size of a request header field exceeds server limit."
    Now, the message is pretty clear, but still quite puzzeling.

    - I obviously exceeded some kind of limmit, but does anybody know how big/small this limmit is? Does it depend on the server?
    - What does the server have to do with cookies, I thought cookies were saved locally?
    - And most importantly, what can I do to prevent this from happening to anybody else?


    You can find the game in question here.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,079
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    Have a look at:-

    http://www.thismuchiknow.co.uk/?p=13


    The real problem, however, comes when you try and set cookies with a large size. The standards state that a browser must support a minimum of 4096 bytes per cookie. IE6 doesn’t do this. Instead, it seems to have a maximum size of 4096 bytes for all cookies from a domain. And, even worse, once this maximum is exceeded, you can’t read or write any further cookies for that domain. The only solution I’ve been able to find is for the user to “Delete cookies…” from Tools > Internet Options > General, and start again.

  • #3
    Regular Coder
    Join Date
    Jan 2006
    Posts
    243
    Thanks
    14
    Thanked 2 Times in 2 Posts
    Thanks for the link, I couldn't find anything on it!

    Unfortunatly, there doesn't appear to be a quick remedy except to prevent the cookie from ever reaching that size. Is there any way to check the cookie size or otherwise prevent it from reaching the 4096 byte limmit?

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,079
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    Quote Originally Posted by Kirl View Post
    Thanks for the link, I couldn't find anything on it!
    Uh? It seems an excellent explanation to me!

    Is there any way to check the cookie size or otherwise prevent it from reaching the 4096 byte limmit?
    Only by reading in the cookie value and counting the number of characters.

  • #5
    Regular Coder
    Join Date
    Jan 2006
    Posts
    243
    Thanks
    14
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by Philip M View Post
    Uh? It seems an excellent explanation to me!
    Haha no, I meant when I searched for it before posting.
    The link was excellent, thanks.


    Only by reading in the cookie value and counting the number of characters.
    I was afraid of something like that, thanks though.


  •  

    Posting Permissions

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