Created
October 30, 2012 15:32
-
-
Save mturac/3980964 to your computer and use it in GitHub Desktop.
p3p problem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (isset($_GET['setdefaultcookie'])) { | |
// top level page, set default cookie then redirect back to canvas page | |
setcookie ('default',"1",0,"/"); | |
$url = substr($_SERVER['REQUEST_URI'],strrpos($_SERVER['REQUEST_URI'],"/")+1); | |
$url = str_replace("setdefaultcookie","defaultcookieset",$url); | |
$url = "http://www.facebook.com/PAGEURL"; | |
echo "<html>\n<body>\n<script>\ntop.location.href='".$url."';\n</script></body></html>"; | |
exit(); | |
} else if ((!isset($_COOKIE['default'])) && (!isset($_GET['defaultcookieset']))) { | |
// no default cookie, so we need to redirect to top level and set | |
$url = $_SERVER['REQUEST_URI']; | |
if (strpos($url,"?") === false) $url .= "?"; | |
else $url .= "&"; | |
$url .= "setdefaultcookie=1"; | |
echo "<html>\n<body>\n<script>\ntop.location.href='".$url."';\n</script></body></html>"; | |
exit(); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment