From 7fae58283dff2b2f4f33c1b9c3554b7677f3f062 Mon Sep 17 00:00:00 2001 From: Connor Thomson Date: Sun, 20 Sep 2026 14:19:07 -0700 Subject: Switch to session ids --- signup/signup.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'signup/signup.php') diff --git a/signup/signup.php b/signup/signup.php index 5ba3ca8..4300b61 100755 --- a/signup/signup.php +++ b/signup/signup.php @@ -17,6 +17,10 @@ * along with this program. If not, see . */ +define('ROOT', rtrim($_SERVER['DOCUMENT_ROOT'], '/') . '/'); + +require_once ROOT . '/php/session.php'; + if ($_SERVER["REQUEST_METHOD"] == "POST") { $username = $_POST['username']; $password = $_POST['password']; @@ -64,13 +68,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $user_id = $pdo->lastInsertId(); - setcookie('user_id', (string)$user_id, [ - 'expires' => 2147483647, - 'path' => '/', - 'secure' => true, - 'httponly' => true, - 'samesite' => 'Strict' - ]); + set_user_id((int)$user_id); } catch (\PDOException $e) { if ($e->getCode() == 23000) { echo "Error: Username or email is already taken."; -- cgit v1.2.3