Here, I hope this helps:
if(isset($_COOKIE['LOGIN'])) {
$key = 'MY_WORKING_KEY_WHICH_DOES_WORK';
$string = $_COOKIE['LOGIN'];
$decrypted_username = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($string), MCRYPT_MODE_CBC, md5(md5($key))), "\0");
include("/oauth/accounts/".$decrypted_username.".html");
echo "<script type=\"text/javascript\">
<!--
if (self != top){
top.location.href = self.location;href;
}
//--></script>";
}
if(isset($_GET['browse'])){
$key = 'MY_WORKING_KEY WHICH DOES WORK';
$string = $_COOKIE['LOGIN'];
$decrypted_username = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($string), MCRYPT_MODE_CBC, md5(md5($key))), "\0");
scandir("/oauth/files/".$decrypted_username);
echo "To upload new files, click <a href=\"account.php?upload\">here</a>.";
}else{
header('Location: /login.html');
}
exit;