Skip to content

Commit

Permalink
revert "fix unable to login if bad btUsername cookie"
Browse files Browse the repository at this point in the history
fixes #112 Log Out is broken
  • Loading branch information
RedDragonWebDesign committed Jan 25, 2024
1 parent de71968 commit 9b5268d
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions src/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,31 +67,6 @@
$fail = false;
echo "
<script type='text/javascript'>
// Fakhruddin Ujjainwala, CC BY-SA 4.0, https://stackoverflow.com/a/24103596/3480193
function setCookie(name,value,days) {
var expires = \"\";
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
expires = \"; expires=\" + date.toUTCString();
}
document.cookie = name + \"=\" + (value || \"\") + expires + \"; path=/\";
}
// When logging in, we need to overwrite any existing cookies, to prevent a bug where you can't log in if you got disabled while logged in.
// You can't set cookies in PHP after you've written any output.
// Therefore, we'll do it in JavaScript.
setCookie(
'btUsername',
'" . $_SESSION['btUsername'] . "',
'" . $COOKIE_EXP_TIME . "'
);
setCookie(
'btPassword',
'" . $_SESSION['btPassword'] . "',
'" . $COOKIE_EXP_TIME . "'
);
window.location = 'members/';
</script>
";
Expand Down

0 comments on commit 9b5268d

Please sign in to comment.