Hi, I have this code, and a file upload form which is submited to a frame:
setMyCookie('name','value_1');
$('.myform').submit();
setMyCookie('name','value_2');
Problem: Webkit browsers seem to update 'MyCookie' with 'value_2' before the form gets submited, or in the exact moment it is being submited, so wrong cookie value is sent with it. I want to change cookie value to 'value_2' immediately after the form is submited so the cookie is ready for another request.
The following code works fine, but I don't think using timeout() is the best solution. Maybe there is another way to solve this problem?
setMyCookie('name','value_1');
$('.myform').submit();
setTimeout(function(){setMyCookie('name',value_2);},100);
Thanks.