Files
ms1inscription-v5/php/inc_start_time.php
stephan 19679875df Implement cookie consent management across various scripts
This commit introduces a comprehensive cookie consent management system by integrating the `fxCookiesAllowMarketing()` function across multiple files. It ensures that marketing-related scripts, such as Facebook Pixel and Google Analytics, are only executed if the user has consented to cookies. Additionally, it enhances the cookie consent UI in `inc_footer.php` and `inc_header.php`, improving user experience and compliance with privacy regulations. The changes also include refactoring of cookie handling functions for better maintainability.
2026-06-27 14:44:44 -04:00

47 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();