I have this code and a file upload form that is sent to the frame:
setMyCookie('name','value_1'); $('.myform').submit(); setMyCookie('name','value_2');
Problem: Webkit browsers seem to update โMyCookieโ with โvalue_2โ before the form is submitted, or the moment it is submitted, so the wrong cookie value is sent with it. I want to change the cookie value to "value_2" immediately after submitting the form so that 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.
ababa source share