带有ajax的Jquery cookie增加了http请求大小

I made an online survey questionnaire which uses ajax to validate and Jquery cookie to store data. When a user fills the questionnaire, the cookie will store the question id, answer id and the comments one by one in the ajax success function. It also increases the http request size and once it crosses size 8k, the site will get stuck. Then I have to delete some comments to reduce the request size. I will post my ajax code here.

function ajaxEx(){
    $.ajax({
        url: 'submit_rep.php',
        type: "POST",
        data: 'aid='+a_id+'&js_cli='+js_cli,
        success:function(data) {
           Cookies.set(""+qid+"", [a_id,textarea],{ expires: 1, path: '/' });
        //here the cookies store questionid answerid and the comments.
        }
    });
 }

Kindly provide me some solution to solve this issue associated with http request. Thanks

Cookies are not the right mechanism to store that kind of information; the size of a cookie is limited (4k) and you can only store about 20 cookies per site in the browser although that information might be a bit out of date by now. And as you noticed they get sent with every browser request.

Either way, if you want to store information on the client side, you should look into local storage and if you need it on the server side, you should use a session (temporary) or something like a database for more permantent storage.