Files
Wallos/includes/connect_endpoint.php
Miguel Ribeiro 4fd87c3014 fix: session expiration on pwa on android (#1023)
fix: image search failing to save
2026-03-21 18:05:59 +00:00

31 lines
714 B
PHP

<?php
$databaseFile = '../../db/wallos.db';
$db = new SQLite3($databaseFile);
$db->busyTimeout(5000);
if (!$db) {
die('Connection to the database failed.');
}
require_once 'i18n/languages.php';
require_once 'i18n/getlang.php';
require_once 'i18n/' . $lang . '.php';
$secondsInMonth = 30 * 24 * 60 * 60;
if (session_status() === PHP_SESSION_NONE) {
session_set_cookie_params([
'lifetime' => $secondsInMonth,
'httponly' => true,
'samesite' => 'Lax'
]);
session_start();
}
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true) {
$userId = $_SESSION['userId'];
} else {
$userId = 0;
}
?>