Files
ms1inscription-v5/php/inc_start_time.php
stephan 2570785030 Refactor account tracing and session handling in compte.php and related files
This commit removes the `fxTraceCompte` functionality from various locations in `compte.php`, `inc_fx_compte.php`, and other related files to streamline the account management flow. The tracing logic is eliminated to enhance performance and reduce complexity. Additionally, the session handling for login redirection is improved by simplifying the logic and removing unnecessary function calls. These changes aim to improve maintainability and clarity in the account management system.
2026-07-07 14:30:53 -04:00

50 lines
1.3 KiB
PHP

<?php
require_once __DIR__ . '/inc_cookie_consent.php';
fxCookiesConsentResetIfRequested();
// a faire trouver une solution
//ini_set('session.cookie_domain', '.ms1inscriptiondev.interne.ca');
//ini_set('session.cookie_domain', '.ms1inscription.com');
//ini_set('session.cookie_domain', '.ms1inscriptiondev.progiweb.net');
$host = $_SERVER['HTTP_HOST'];
// Enlève "www." s'il est présent
$host = preg_replace('/^www\./', '', $host);
// Enlève "preprod." s'il est présent
$host = preg_replace('/^preprod\./', '', $host);
// Pas de point au début
$cookie_domain = $host;
ini_set('session.cookie_domain', $cookie_domain);
//echo($cookie_domain);
// Démarrez la session
session_start();
// Temps de la session = 60 min
// MSIN-CON-259
//ini_set('session.gc_maxlifetime', 10800);
$inactive = 10800;
if (isset($_SESSION['date_maj']) && (time() - $_SESSION['date_maj'] > $inactive)) {
if (isset($_SESSION['com_info']) && $_SESSION['com_id'] > 0) {
require_once('php/inc_fonctions.php');
require_once('php/inc_fx_panier.php');
require_once('php/inc_fx_compte.php');
fxLogout($_GET['lang']);
}
}
/* if (!isset($_SESSION['no_panier']) && isset($_COOKIE['no_panier']))
$_SESSION['no_panier'] = $_COOKIE['no_panier']; */
$_SESSION['date_maj'] = time();
if (!empty($_SESSION['usa_id'])) {
$_SESSION['logged'] = time();
}