I am working on an application that pulls in information from another one and iframes it in mine. I need to be able to authenticate off the other system.
It was/is working using a jQuery submit to a hidden form, but timing issues are making it tricky.
What I would like to do is an ajax post to the other system and have the cookies set so on ajax completion I can transfer them to another page.
My code currently looks like this:
$(document).ready(function() {
$.post('Anotherserveronasubdomain.com', {
username : '<?php echo $username ?>',
passowrd : '<?php echo $password ?>',
action : 'logon'
}, function(data) {
alert(data);
//$(location).attr('href', 'apagewiththerightinformationifcookiesareset.php');
});
});
That script doesn't return anything and therefore cookies aren't set. Is there a way to have the remote system set those cookies or am I running in circles here?
Thanks for your time.