Selamat siang, saya mau menanyakan perihal HTTP ORIGIN karena tidak terbaca. Padahal di php sudah diset, saya sudah coba tanya di StackOverFlow, ada kemungkinan karena setting default dari server. Jadi untuk lebih pastinya saya coba tanyakan disini. Berikut ini kode php saya
<?php
$httporigin = $_SERVER['HTTP_ORIGIN'];
if($httporigin=="http://nielinfo.com"){
header("Access-Control-Allow-Origin: ".$httporigin);
header('Access-Control-Allow-Methods: POST');
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept');
header('Access-Control-Allow-Credentials: true');
echo $_COOKIE['username'];
}
?>
XMLHttpRequest cannot load https://igoblogging.com/likebutton/. The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'http://nielinfo.com' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
Response Header
Access-Control-Allow-Credentials:true
Access-Control-Allow-Headers:Origin, X-Requested-With, Content-Type, Accept
Access-Control-Allow-Methods:POST
Access-Control-Allow-Origin:*
Cache-Control:max-age=604800
Connection:close
Content-Encoding:gzip
Content-Type:text/html; charset=utf-8
Date:Wed, 12 Jul 2017 06:23:18 GMT
Expires:Wed, 19 Jul 2017 06:23:18 GMT
Server:nginx/1.13.1
Transfer-Encoding:chunked
Vary:Accept-Encoding
X-Content-Type-Options:nosniff
X-Frame-Options:SAMEORIGIN
X-Powered-By:PHP/5.4.45
X-Supported-By:Kloxo-MR 7.0
X-XSS-Protection:1;mode=block
Untuk lebih jelasnya bisa cek langsung di
http://nielinfo.comMohon bantuannya, soalnya saya bingung banget udah coba dari kemarin2, macem2 kode udah saya coba implemantasiin tapi hasilnya tetap sama saja. Terbacanya wildcard (*), settingan phpnya tidak terload. Thanks.