<?php
$cookie_file_path = realpath('cookie.txt'); // Please set your Cookie File path

$curlHeaders = array(
                "Accept"=>"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
                "Accept-Encoding"=>"gzip, deflate, br",
                "Accept-Language"=>"en-US,en;q=0.9,hi;q=0.8",
                "Cache-Control"=>"max-age=0",
                "Connection"=>"keep-alive",
                "Content-Length"=>"1983",
                "Content-Type"=>"application/x-www-form-urlencoded",
                "Cookie"=>"TLS=v=1.2&r=1; F=a=Je9gDhUMvSR0sMPTcI08Dn9C.9AEDON1mspybRCJmtgrCHGUuG7LT.Fv.YI_6CTkNSSCQGw-&b=5P6h; YLS=v=2&p=1&n=1; B=3gi8i9le0mij9&b=3&s=d4&b=4&d=SNkLGqlpYF0t1pMr5rb_.H8L.Ou3K.jrfga5trmi&s=vo&i=cO6fexArEd96dbS44.ZZ",
                "Host"=>"login.yahoo.co.jp",
                "Origin"=>"https://login.yahoo.co.jp",
                "Referer"=>"https://login.yahoo.co.jp/config/login?.src=auc&.done=https%3A%2F%2Fauctions.yahoo.co.jp%2F",
                "Upgrade-Insecure-Requests"=>"1",
                "User-Agent"=>"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
                );

$fp = fopen($cookie_file_path,'w');


$agent = "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36";

$reffer = "https://login.yahoo.co.jp/config/login?.lg=jp&.intl=jp&logout=1&.src=auc&.done=https%3A%2F%2Fauctions.yahoo.co.jp%2F";

// log out.
$LOGINURL = "https://login.yahoo.co.jp/id_check?login=hbjun56371&bcrumb=dD13cDFDY0Imc2s9RlNuTW0yQ3lRR2hfekJYMTd0TGdGeTJaQzVrLQ==&verify=0&.display=&time=1544247944856&fido=0";
$ch = curl_init();
//curl_setopt($ch, CURLOPT_HTTPHEADER, $curlHeaders);
//curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_URL,$LOGINURL);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
//curl_setopt($ch, CURLOPT_REFERER, $reffer);
//curl_setopt($ch, CURLOPT_PROXY, '206.221.182.74:2083');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch,CURLOPT_COOKIE, "TLS=v=1.2&r=1;YLS=v=2&p=1&n=1;B=3gi8i9le0mij9&b=3&s=d4;F=a=bfvPNk0MvSSHZUA.rgM5zke53cMd6zAZF915r1q3_itIWD_JnlENvnVq1bDWBV794eCXIuw-&b=9jNQ;B=3gi8i9le0mij9&b=4&d=SNkLGqlpYF0t1pMr5rb_.H8L.Ou3K.jrfga5trmi&s=10&i=lQsp06I7Hjv2KskGuY9b");
//curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
//curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
$result = curl_exec ($ch);
var_dump($result);
echo curl_error($ch);
curl_close ($ch);
fclose($fp);
exit();
sleep(5);

$field=array(
        ".ct"=>"",
        ".display"=>"",
        ".done"=>" https://auctions.yahoo.co.jp/",
        ".keep"=>"",
        ".reg"=>"https://account.edit.yahoo.co.jp/registration?src=auc&done=https%3A%2F%2Fauctions.yahoo.co.jp%2F&sr_required=birthday+gender+postcode+deliver",
        ".src"=>"auc",
        ".suppreg_skip"=>"",
        ".yby"=>"",
        "auth_lv"=>"pw",
        "card_cushion_skip"=>"",
        "ckey"=>"",
        "nolink"=>"",
        "nonotice"=>"",
        "noreg"=>"",
        "referrer"=>"",
        "t_cushion"=>"",
        ".albatross"=>"dD1EcTBDY0Imc2s9c0I1ZVZpVWIuR1VLLnFMT25IcGVlbHBlWnNVLQ==",
        ".requiredPsCheckBox"=>"",
        ".slogin"=>"",
        ".tries"=>"1",
        "ls_autocomp"=>"",
        "showpw_status"=>"",
        "u"=>"4n2v94pe0mik3",
        "inactive_pw"=>"",
        "send_sms_counts"=>"1",
        "send_mail_counts"=>"1",
        "version"=>"",
        "auth_method"=>"pwd",
        "pwless_captchaid"=>"" ,
        "masked_dest"=>"",
        "bcrumb_id_check"=>"dD1EcTBDY0Imc2s9aFl6VFRRQkMubHJPbGZveUFwZTRNeTY2cFJvLQ==",
        "bcrumb_send_sms"=>"dD1EcTBDY0Imc2s9SVNSYUFuS09Pa0VMRVZNRjU1Tk1PdWNseHdFLQ==",
        "bcrumb_send_mail"=>"dD1EcTBDY0Imc2s9S01FVHc3OEFOeDFuOXNOaTZwLlF6UVhMRnRvLQ==",
        "user_name"=>"hbjun56371",
        "sms_push"=>"",
        "assertionInfo"=>"",
        "webauthn"=>"",
        "fido"=>"0",
        "auth_list"=>"pwd",
        "login"=>"hbjun56371",
        "passwd"=>"@mshs2009#",
        "code"=>"",
        "btnSubmit"=>"",
        ".persistent"=>"y",
        "yjbfp_items"=>"uaMozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36langen-USscreen_height768screen_width1366timezone_offset-330pluginsChrome PDF Plugin|Chrome PDF Viewer|Native Clientcanvas_imageiVBORw0KGgoAAAANSUhEUgAAABAAAAAWCAYAAADJqhx8AAAByUlEQVQ4T9WUv0vDUBSFv1AsaHUSxCylEmsddXGTgiJ2UhcFsY4OpaCIuLo4OQn+Dw61ILgFpJPoIDg4OLTWWlJKgqBYtFGMEnlP6s9apYrgnV6Sdw/3OznvKfywFNHvuhtuvTr/SGB9HXZ2YHUVGhtfgP8eYX/fxDCuGBnR8Ho9PE+wvOxSLCpvRnw99ubmFwi7uy7xOCQSCqEQ3NzA/Dz098PUFHzpwfm52OgSDucJBh26uzUWFjysrUGpZKLrVxSLGtPTZ1hWFQThq8AoFC7p6TFoaOjk4MDHysoD29snGEYLmYxKNGp+LpBOw9zcHUNDGdLpVsJhlcHBMrqex3ECUrCmQIVbVU85OnJYWtKw7TPpum1r7O15agsIDGFWPF5mYiLP4qKfw0MTv7+F42NVBqnmBEJAYExO3jM2lmNgoIlstkQkEiCV8n1fYHYWYjGTQsFCVX0yNMmk53sCAiGXc5mZsdnaytLb20Zfnyr/kKjhYat6Eis5ePJBwXGe3A+FAsRiTbJZhExkomqU318oIvMXF7dEIh1vPun6qXyuvP9wGq+v70gmM3LT+HgXzc1eubasskQSNTraSXu7T65/5zjXex+KvkcATSsyIKf0dAAAAABJRU5ErkJggg=="
        );
        
	$host = "https://login.yahoo.co.jp/config/login";

    $agent       = 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36';
    $curlHeaders = array(
                "Accept"=>"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
                "Accept-Encoding"=>"gzip, deflate, br",
                "Accept-Language"=>"en-US,en;q=0.9,hi;q=0.8",
                "Cache-Control"=>"max-age=0",
                "Connection"=>"keep-alive",
                "Content-Length"=>"1983",
                "Content-Type"=>"application/x-www-form-urlencoded",
                "Cookie"=>"TLS=v=1.2&r=1; F=a=Je9gDhUMvSR0sMPTcI08Dn9C.9AEDON1mspybRCJmtgrCHGUuG7LT.Fv.YI_6CTkNSSCQGw-&b=5P6h; YLS=v=2&p=1&n=1; B=cteocste0k1no&b=4&d=SNkLGqlpYF0t1pMr5rb_.H8L.Ou3K.jrfga5trmi&s=vo&i=cO6fexArEd96dbS44.ZZ",
                "Host"=>"login.yahoo.co.jp",
                "Origin"=>"https://login.yahoo.co.jp",
                "Referer"=>"https://login.yahoo.co.jp/config/login?.src=auc&.done=https%3A%2F%2Fauctions.yahoo.co.jp%2F",
                "Upgrade-Insecure-Requests"=>"1",
                "User-Agent"=>"Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
                );
    $ch          = curl_init();
    curl_setopt($ch, CURLOPT_HTTPHEADER, $curlHeaders);
    curl_setopt($ch, CURLOPT_HEADER, TRUE);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // following redirects or not
    curl_setopt($ch, CURLOPT_USERAGENT, $agent);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $field);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
	curl_setopt($ch, CURLOPT_COOKIE, "TLS=v=1.2&r=1;B=3gi8i9le0mij9&b=3&s=d4");
	curl_setopt($ch, CURLOPT_COOKIEJAR, realpath('cookie.txt'));
	curl_setopt($ch, CURLOPT_COOKIEFILE, realpath('cookie.txt'));
    curl_setopt($ch, CURLOPT_URL, $host);
    $result      = curl_exec($ch);
    var_dump($result);
	//$result = curl_exec($ch);
	
	curl_close($ch);
	
?>