이것은 내 사이트에서 실행되는 전체 HTML 코드입니다. 내 사이트의 다른 사이트에서 가져온 쿠키를 인증 쿠키로 사용하고 싶습니다.PHP에서 쿠키를 설정하는 방법 <HTML>
: 내가 설정 - 쿠키를 위해 인증처럼 행동 할 Example Site<html>
<head>
<link rel='stylesheet' href='http://releases.flowplayer.org/7.0.2/commercial/skin/skin.css'>
<link rel="stylesheet" href="http://demos.flowplayer.org/media/css/codepen.css">
<script src="//code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="http://releases.flowplayer.org/7.0.2/commercial/flowplayer.min.js"> </script>
<script src="//releases.flowplayer.org/hlsjs/flowplayer.hlsjs.min.js"> </script>
</head>
<style>
.flowplayer {
background-color: #0084ef;
}
.flowplayer .fp-color-play {
fill: #eee;
}
</style>
<body>
<script>
window.onload = function() {
flowplayer("#hlsjslive", {
splash: true,
embed: true,
autoplay: true,
ratio: 9/16,
hlsjs: {
xhrSetup: function(xhr) {
xhr.withCredentials = true;
}
},
clip: {
live: true,
sources: [
{ type: "application/x-mpegurl",
src: "<?php
$expire = time() + 2592000;
$proto = 'http://';
$domain = 'nlds16.cdnak.neulion.com';
$path = 'nlds/nba/nba247/as/live/ipad.m3u8';
$key = '0326ebdb3e654166a66d3c62';
$params = 'expires='.$expire.'&access=/nlds/nba/nba247/as/live/*';
function h2b($str) {
$bin = "";
$i = 0;
do {
$bin .= chr(hexdec($str{$i}.$str{($i + 1)}));
$i += 2;
} while ($i < strlen($str));
return $bin;
}
$hash = hash_hmac('MD5', $params, h2b($key));
echo $proto.$domain.'/'.$path.'?hdnea='.$params.'&md5='.$hash.'&nltid=nba&nltdt=6';
?>" }
]
}
});
};
</script>
<div align="center"></div>
<div id="hlsjslive" class="fp-slim fp-mute is-closeable"></div>
</body>
</html>
: 지금 나는 HTTP 헤더에 나올 내가 쿠키를 원하는 방법의 예를 출력하는 URL에 쿠키를 설정할 수 없습니다
<?php
$name = 'X-NL-SK-nlds-nba-nba247-as-live';
$value = 'FJsmSPq%2Fb%2Fuc1mg3XEUVTCmpch6EwNny1T%2BUC73GMMgfLLyuX%2FAFdbfa31JySSsjoKSyzSrmysXRv%2Bl3TpFlRV3NAaygVw2hZqm76uD8UhwZqFOWNEMGNa9qT7pEHEVL'
$expireDate = time()+86400;
$path = '/';
$domain = '.neulion.com';
$secure = false;
$httponly = true;
setcookie($name, $value, $expireDate, $path, $domain, $secure, $httponly);
?>
당신은'header ("Set-Cookie : name = user ......");'을 시도 했습니까? – Arun
해결할 수 있었습니까? 해결 방법을 찾고 있는데, 링크의 유효성을 확인하는 것은 어떨까요? 당신이 그것을 해결할 수 있다면, 알려주세요. –