$.ajax({
type: 'POST',
url: 'chat.php',
data: {
id: 0,
idClient: 1,
},
success:function(response){
idClient = setCookie('idClient', response, '');
return idClient;
}
});
console.log(idClient);