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

Commit ffcc50e

Browse files
authored
update a thing or two with cookies
1 parent 8483d5c commit ffcc50e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

framework.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ function login($username, $password){
135135
if($usecookies){
136136
global $_COOKIE;
137137
setcookie("DO NOT GIVE YOUR COOKIES TO ANYBODY", "DO NOT GIVE YOUR COOKIES TO ANYBODY", time()+99999);
138-
setcookie("token", $token, time()+99999);
139-
setcookie("id", $row["id"], time()+99999);
140-
setcookie("username", $row["username"], time()+99999);
138+
setcookie("token", $token, time()+99999, "/");
139+
setcookie("id", $row["id"], time()+99999, "/");
140+
setcookie("username", $row["username"], time()+99999, "/");
141141
return 1;
142142
} else {
143143
global $_SESSION;
@@ -158,18 +158,19 @@ function logout(){
158158
global $usecookies;
159159
if($usecookies){
160160
setcookie('DO NOT GIVE YOUR COOKIES TO ANYBODY', null, -1);
161-
setcookie('token', null, -1);
162-
setcookie('id', null, -1);
163-
setcookie('username', null, -1);
161+
setcookie('token', null, -1, '/');
162+
setcookie('id', null, -1, '/');
163+
setcookie('username', null, -1, '/');
164164
return 1;
165165
} else {
166166
session_destroy();
167167
return 1;
168168
}
169169
}
170170

171+
171172
function checktoken($username, $token){
172173
return "not implemented";
173174
}
174-
//checkver("b1024");
175+
//checkver("b1026");
175176
?>

0 commit comments

Comments
 (0)