login change

This commit is contained in:
2025-11-22 01:44:03 +01:00
parent a5ce6a079a
commit b3a3d25502
9 changed files with 474 additions and 35 deletions

View File

@@ -1,5 +1,26 @@
<?php
ini_set('display_errors', 0);
ini_set('display_startup_errors', 0);
error_reporting(E_ALL); // aber in ein Log schreiben lassen
if (php_sapi_name() !== 'cli') {
// Session nur starten, wenn noch keine läuft
if (session_status() === PHP_SESSION_NONE) {
// Optional: Session-Konfiguration vor session_start
session_name('usbcheck_session');
session_set_cookie_params([
'lifetime' => 0, // Session-Cookie
'path' => '/',
'domain' => '', // leer = aktuelle Domain
'secure' => (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off'),
'httponly' => true,
'samesite' => 'Lax', // oder 'Strict' falls du sehr streng sein willst
]);
session_start();
}
}
require __DIR__ . "/config.php";
require __DIR__ . "/db.php";
require __DIR__ . '/../src/functions.php';

View File

@@ -2,6 +2,26 @@
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
// Nur im Web-Kontext (nicht in CLI-Skripten)
if (php_sapi_name() !== 'cli') {
// Session nur starten, wenn noch keine läuft
if (session_status() === PHP_SESSION_NONE) {
// Optional: Session-Konfiguration vor session_start
session_name('usbcheck_session');
session_set_cookie_params([
'lifetime' => 0, // Session-Cookie
'path' => '/',
'domain' => '', // leer = aktuelle Domain
'secure' => (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off'),
'httponly' => true,
'samesite' => 'Lax', // oder 'Strict' falls du sehr streng sein willst
]);
session_start();
}
}
require __DIR__ . "/config.php";
require __DIR__ . "/db.php";
require __DIR__ . '/../src/functions.php';