I execute two GET requests using AJAX, the first request is authorization, the second request is data acquisition.
The second request does not work, because no authentication data is sent to it.

After successful authorization, I need to generate the $token=md5(username+password+secret_key) hash $token=md5(username+password+secret_key) and pass it in the response body. Then the remaining requests to perform with this hash and log in to it.
Tell me how to do this?

    1 answer 1

    Well, for example on jQuery you can do this:

     $.ajax({ url : "someUrl", type : 'GET', data : { someData : someData }, success: function(data) { //c php получаем данные (к примеру JSON) var obj = jQuery.parseJSON(data); $.ajax({ url :"someUrl2", type :'GET', data :{ someData2: obj.someData2 }, success:function(data2) { var obj2 = jQuery.parseJSON(data2); if (obj2.status == 'ok') { //some code here } } }) } }) return false;