S
S
smoln2018-05-14 13:14:40
JavaScript
smoln, 2018-05-14 13:14:40

Why are cookies not being sent via ajax?

I define via ajax I send the necessary data to the ajax.php file
setcookie("client",$client, time()+3600,"/");

function storage(id){
$.post(str,{ 
search: $('#s'+id).val()
}, function(data){
 $('#storage_result'+id).html(data);
});
  return false;
}//storage

in ajax php
session_start(); 
$client=$_COOKIE['client'];
print_r($client);

Outputs nothing!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
�
✭☭, 2018-05-14
@Yertuwernat

https://learn.javascript.ru/xhr-crossdomain#%D0%B7...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question