Skip to content

Instantly share code, notes, and snippets.

@phpfiddle
Created June 5, 2017 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phpfiddle/0432199b6d7ae3fcf169697d0e5851ff to your computer and use it in GitHub Desktop.
Save phpfiddle/0432199b6d7ae3fcf169697d0e5851ff to your computer and use it in GitHub Desktop.
[ Posted by Antonio Osorio ] prueba crumbstore
<?php
setcookie("test_cookie", "test", time() + 3600, '/');
?>
<html>
<body>
<?php
$seedUrl = "https://finance.yahoo.com/quote/%5EGSPC/history?period1=1496548800&period2=1496635200&interval=1d&filter=history&frequency=1d";
$f = file_get_contents($seedUrl);
$f = htmlentities($f);
$f = utf8_encode($f);
$cs = strpos($f,"CrumbStore");
$cr = strpos($f,"crumb",$cs+10);
$cl = strpos($f,':', $cr + 5);
$q1 = strpos($f,'&quot;', $cl+1);
$q2 = strpos($f,'&quot;', $q1 + 1);
$crumb = substr($f, $q1 + 6, $q2-$q1-6);
echo "crumb= " . $crumb ."<br><br>";
print_r($_COOKIE);
echo "<br><br><br>" . $f;
/*
echo "<script>console.log( 'Debug Objects: " . $f . "' );</script>";
if(count($_COOKIE) > 0) {
echo "Cookies are enabled.";
} else {
echo "Cookies are disabled.";
}
*/
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment