This commit introduces new functions for logging and host validation in the account tracing system, improving the ability to track user actions in development and pre-production environments. Additionally, it adds a bootstrap function call in inc_start_time.php to initialize tracing early in the request lifecycle. These changes aim to enhance debugging capabilities and ensure reliable logging across different environments.
54 lines
1.4 KiB
PHP
54 lines
1.4 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();
|
|
|
|
require_once __DIR__ . '/inc_fx_trace_compte.php';
|
|
fxTraceCompteBootstrap();
|
|
|
|
|
|
// 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();
|
|
} |