Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Commit

Permalink
update a thing or two with cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
TermOfficial authored Apr 18, 2022
1 parent 8483d5c commit ffcc50e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ function login($username, $password){
if($usecookies){
global $_COOKIE;
setcookie("DO NOT GIVE YOUR COOKIES TO ANYBODY", "DO NOT GIVE YOUR COOKIES TO ANYBODY", time()+99999);
setcookie("token", $token, time()+99999);
setcookie("id", $row["id"], time()+99999);
setcookie("username", $row["username"], time()+99999);
setcookie("token", $token, time()+99999, "/");
setcookie("id", $row["id"], time()+99999, "/");
setcookie("username", $row["username"], time()+99999, "/");
return 1;
} else {
global $_SESSION;
Expand All @@ -158,18 +158,19 @@ function logout(){
global $usecookies;
if($usecookies){
setcookie('DO NOT GIVE YOUR COOKIES TO ANYBODY', null, -1);
setcookie('token', null, -1);
setcookie('id', null, -1);
setcookie('username', null, -1);
setcookie('token', null, -1, '/');
setcookie('id', null, -1, '/');
setcookie('username', null, -1, '/');
return 1;
} else {
session_destroy();
return 1;
}
}


function checktoken($username, $token){
return "not implemented";
}
//checkver("b1024");
//checkver("b1026");
?>

0 comments on commit ffcc50e

Please sign in to comment.