« Back to History
session_boot.php
|
20260721_154033.php
Initial Bulk Import
Copy Code
<?php // /erp/modules/auth/session_boot.php // Single source of truth for PHP sessions (path + cookie settings) $__sess_dir = dirname(__DIR__, 2) . '/tmp_sessions'; if (!is_dir($__sess_dir)) { @mkdir($__sess_dir, 0775, true); } // Use SAME path everywhere @ini_set('session.save_path', $__sess_dir); // Consistent cookie so subpaths me share ho: // Path: "/" (ya "/erp" — agar aap app ko hamesha /erp me chalate hain) $cookieParams = session_get_cookie_params(); session_set_cookie_params([ 'lifetime' => 0, 'path' => '/', // <== important (ya '/erp' if needed) 'domain' => $cookieParams['domain'] ?? '', 'secure' => isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on', 'httponly' => true, 'samesite' => 'Lax', ]); if (session_status() !== PHP_SESSION_ACTIVE) { session_start(); }