# Cookies and IE7. Circumvent 4KB limit?

**URL:** <https://www.ruby-forum.com/t/cookies-and-ie7-circumvent-4kb-limit/151917>\
**Category:** Rails\
**Created:** [October 27, 2008, 9:44pm UTC](https://www.ruby-forum.com/t/cookies-and-ie7-circumvent-4kb-limit/151917 "2008-10-27T21:44:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisdwan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/7feea3/32.png) [@chrisdwan](https://www.ruby-forum.com/u/chrisdwan)\
**Post date:** [October 27, 2008, 9:44pm UTC](https://www.ruby-forum.com/t/cookies-and-ie7-circumvent-4kb-limit/151917/1 "2008-10-27T21:44:10Z")

</div>

I run a website with a Google Maps on there on which I draw custom tile  
images with the help of RMagick.

To give a pleasant and responsive user experience I supply minimal  
position data through a cookie with the tiles and have local JavaScript  
pick it up, digest it and act on it when the mouse is moved on the map.  
This works great as long as the items on 1 tile remains minimal.

Whenever the item data in the cookie grows over 3KB (4KB escaped) I  
split it into several cookies. Internet Explorer 7 was patched last year  
to now accept 50 instead of 20 cookies per domain, yet the hardest limit  
of 4KB for ALL COOKIES in the document still remains.

Is there a way to make it happen that the limit of 4KB only applies to a  
single cookie? Like FireFox handles it? Or do I have to resort to  
alternative measures involving an extra call to the server.

---

<div class="post-metadata">

**Author:** ![chrisdwan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/7feea3/32.png) [@chrisdwan](https://www.ruby-forum.com/u/chrisdwan)\
**Post date:** [October 28, 2008, 10:56am UTC](https://www.ruby-forum.com/t/cookies-and-ie7-circumvent-4kb-limit/151917/2 "2008-10-28T10:56:06Z")

</div>

On 27 Oct 2008, at 21:44, Chris D. wrote:

> alternative measures involving an extra call to the server.  
> And how about instead of abusing cookies for something they weren’t  
> made to do, doing the following:

 ...

â€¢ No cookie abuse (that’s not what they’re there for, they were made  
for persisting data across requests and site visits, not for passing  
in data)  
â€¢ No 3KB data limit  
â€¢ Same behavior  
â€¢ In case it matters: indexable by google and other search engines

Best regards

Peter De Berdt

---

<div class="post-metadata">

**Author:** ![chrisdwan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/7feea3/32.png) [@chrisdwan](https://www.ruby-forum.com/u/chrisdwan)\
**Post date:** [October 28, 2008, 2:03pm UTC](https://www.ruby-forum.com/t/cookies-and-ie7-circumvent-4kb-limit/151917/3 "2008-10-28T14:03:40Z")

</div>

Peter De Berdt wrote:

> On 27 Oct 2008, at 21:44, Chris D. wrote:
> 
> > alternative measures involving an extra call to the server.  
> > And how about instead of abusing cookies for something they weren’t  
> > made to do, doing the following:
> 
> ...
> 
> â€¢ No cookie abuse (that’s not what they’re there for, they were made  
> for persisting data across requests and site visits, not for passing  
> in data)  
> â€¢ No 3KB data limit  
> â€¢ Same behavior  
> â€¢ In case it matters: indexable by google and other search engines
> 
> Best regards
> 
> Peter De Berdt

Thanks for your input but your solution isnt really an applicable  
option. I know cookies aren’t there for what I wanted to do. It is a  
great way to serve meta data with the image tiles at the same time  
though.

Since Google Maps API handles all the requests for the tile, there is no  
way to come inbetween there to fill some div with my JS data like you  
suggested. If you have a practical example I’d be very glad to see it.

The data for each tile is very specific and based on several parameters  
hashed to a tile name. So indexing by Google is unwanted even.

---

<div class="post-metadata">

**Author:** ![chrisdwan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/7feea3/32.png) [@chrisdwan](https://www.ruby-forum.com/u/chrisdwan)\
**Post date:** [October 28, 2008, 7:57pm UTC](https://www.ruby-forum.com/t/cookies-and-ie7-circumvent-4kb-limit/151917/4 "2008-10-28T19:57:59Z")

</div>

On 28 Oct 2008, at 14:03, Chris D. wrote:

> Since Google Maps API handles all the requests for the tile, there  
> is no  
> way to come inbetween there to fill some div with my JS data like you  
> suggested. If you have a practical example I’d be very glad to see it.

Unless I’m totally wrong on what you’re trying to do, here’s some  
pseudocode on how I see it:

- _37.4419, -122.1419_
put any content for your marker here
- _38.4523, -121.1887_
put other content here

Javascript pseudocode (won’t work, but you get the picture):

$(‘positional-data’).select(‘li).each(function(el) {  
new GMarker(new google.maps.LatLng(el.down(‘em’).innerHTML),  
el.down(’.content’));  
});

Best regards

Peter De Berdt
