0

I have form that send the content, via ajax, to another php file: "commants-manage.php".

Except the content i need be able to use the value of the language cookie.

When i print cookie value in the ajax file i don't received the value i put in the main page

JS:

$.ajax({
    type        : 'POST',
    url         : 'ajax/commants-manage.php', 
    data        : formData, 
    dataType    : 'json',
    code        : true
})
    .done(function(data) {
......
}

AJAX FILE

session_start();
echo $_COOKIE['user_lang'];

....
..
.
?>
Roi
  • 49
  • 8
  • 1
    You can also get the cookie value through JavaScript. https://stackoverflow.com/questions/4825683/how-do-i-create-and-read-a-value-from-cookie – Qirel Sep 05 '17 at 10:20
  • 1
    Cookie and Session isnt the same. http://php.net/manual/de/function.setcookie.php – A. Blub Sep 05 '17 at 10:21

0 Answers0