summaryrefslogtreecommitdiff
path: root/signup/signup.php
diff options
context:
space:
mode:
authorConnor Thomson <blumatrikz@gmail.com>2026-09-20 14:19:07 -0700
committerConnor Thomson <blumatrikz@gmail.com>2026-09-20 14:19:07 -0700
commit7fae58283dff2b2f4f33c1b9c3554b7677f3f062 (patch)
tree6bbcf93cb44f66801541f7789a9b0d07a8700c57 /signup/signup.php
parent1177a625e825766c7727b254bc72718fd88e8145 (diff)
Switch to session ids
Diffstat (limited to 'signup/signup.php')
-rwxr-xr-xsignup/signup.php12
1 files changed, 5 insertions, 7 deletions
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 <https://www.gnu.org/licenses/>.
*/
+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.";