js ajax post api with cookie
http://node.tedshd.io/cors_post_cookie/
or
http://api.tedshd.io/cors_post_cookie/
click api response php set cookie button
and api can set cookie TestCookie=this is test
click post api button
api on server side can get cookie & response cookie
echo 'Hello ' . htmlspecialchars($_COOKIE["TestCookie"]) . '!';