views:

22

answers:

1

Hello, i use jsonp to post a form to a remote script. the code is something like this:

$.ajax({
   type: "get",
   datatype: "jsonp",
   url: 'http://other-domain.com/process_form.php?param1=x&' + $("#gs_vote_form").serialize(),
   data: $("#gs_vote_form").serialize(),
   success: function(data) {
    alert('form submitted successfully'); 
   }
  });

The form IS submitted, but... The process_form.php completely ignores cookie data that belong to the "other-domain" (does not read or write them), which is the problem for me.

Please note, i do not care about the returned data, i only use jsonp to submit the form from one site to the other silently, without actually transferring the user to the other site.

Is there any workaround for this? Something that will make cookies work?

A: 

What browser?

Cookies on other-domain will be ‘third-party cookies’, and thus in IE subject to tighter controls, as configured in the ‘privacy’ settings tab. That means, for IE's default settings, that other-domain will be prevented from using cookies unless it sets a P3P policy. (Other browsers don't use P3P as many consider it a somewhat pointless Liar's Charter.)

'?param1=x;' + $("#gs_vote_form").serialize(),

Really, are you sure other-domain allows the use of ; as an alternative parameter separator to &? Sadly PHP does not support this unless explicitly reconfigured to do so.

bobince
fractalbit