Vivek
Vivek

Reputation: 621

AJAX requests and CookieOverflow in RoR

I'm making a dynamic checklist and I'm having some problems with AJAX requests and database updating. Basically when an item is clicked, I asynchronously update the database to say that an item has been clicked. Here is the javascript :

    $('.checkBoxContainer').click( function() {
    $(this).css("background-color", "#FFF3D8");
    $(this).find("input").attr("disabled", "disabled")
    $(this).find("p").css("text-decoration", "line-through")
                     .css("color", "#AAA");
    $.ajax({
        type : "POST",
        url : "updateDone",
        data : "id=" + $(this).attr("id") 
    });
});

Here is the method in the controller

def updateDone
    currentItem = Item.find(params[:id])
    currentItem.update_attribute(:done => true)
  end

The following code works for only 5 items or so before the command prompt shoots me a "Cookie Overflow" error. I'm not using any cookie or session data so how is this producing this error? If it turns out to be a cookie problem (though I don't see how) how would I clear the session/cookie data in the server/browser so the client can make more than 5 items on the checklist?

Upvotes: 1

Views: 107

Answers (1)

clyfe
clyfe

Reputation: 23770

Either store less stuff in the session, or move the session store to memcache.
The default cookie based session store can only hold upto ~ 4kb of data, because cookies as per standard are not allowed to have a bigger size.

Upvotes: 3

Related Questions