Sample text
This commit is contained in:
@ -4,12 +4,8 @@ require_once("_db.php"); //("api/_db.php");
|
||||
|
||||
|
||||
|
||||
// Check if request was to specified file
|
||||
function ThisFileIsRequested ($fullpath) {
|
||||
return substr($fullpath, -strlen($_SERVER["SCRIPT_NAME"])) === $_SERVER["SCRIPT_NAME"];
|
||||
}
|
||||
|
||||
session_start();
|
||||
//session_start();
|
||||
// This ^ should be placed at login stage
|
||||
|
||||
$LOGGED_IN = false;
|
||||
|
||||
@ -25,6 +21,18 @@ if (isset($_SESSION["userid"])) {
|
||||
die("user id used in session does not exist");
|
||||
}
|
||||
$LOGGED_IN = true;
|
||||
} else {
|
||||
// ATTENTION: idk will this work, but this can be theoretically unsafe or cause fault
|
||||
|
||||
if (session_status()) {
|
||||
session_unset();
|
||||
session_destroy();
|
||||
}
|
||||
|
||||
if (isset($_COOKIE["PHPSESSID"])) {
|
||||
unset($_COOKIE["PHPSESSID"]);
|
||||
setcookie("PHPSESSID", "", time() - 3600, "/");
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user