Rip out sessions, they don't work cross domain. Rely on information received previously. Sessions will not extend past the current browser session most likely.

This commit is contained in:
zontreck 2024-05-16 13:06:24 -07:00
parent a490412f6b
commit 75de51ec14
7 changed files with 157 additions and 167 deletions

View file

@ -73,6 +73,4 @@ function gen_uuid()
mt_rand(0, 0xffff)
);
}
session_start();
?>

View file

@ -34,7 +34,6 @@ if($clientKey == CLIENTPSK) {
if(md5($password.":" . $pwSalt) == $pwHash) {
// Login Success
$_SESSION['login'] = "1";
$id = $row['UUID'];
$first = $row['FirstName'];
$last = $row['LastName'];

View file

@ -2,7 +2,7 @@
if(!defined("COMMON"))
require ("Common.php");
session_destroy();
// Edit database?
die(json_encode(array(
"done" => true,

View file

@ -20,13 +20,6 @@ if(!defined("CLIENTPSK")) {
// Authorized. Send the PSK value to the client
$allow=true;
$psk = PSK;
// Check session
if(isset($_SESSION['login'])) {
$logged_in = true;
$user = $_SESSION['user'];
$display_name = $_SESSION['display_name'];
}
}else {
$allow=false;
}
@ -42,10 +35,7 @@ if(!defined("CLIENTPSK")) {
$ret = array(
"type" => "S2CPong",
"authorized" => $allow,
"user" => $user,
"display_name" => $display_name,
"psk" => $psk,
"login" => $logged_in,
"user_count" => $totalUsers
);