16 lines
396 B
PHP
16 lines
396 B
PHP
|
|
<?php
|
||
|
|
if (session_status() === PHP_SESSION_NONE) {
|
||
|
|
$isSecure = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off';
|
||
|
|
ini_set('session.use_strict_mode', '1');
|
||
|
|
session_set_cookie_params([
|
||
|
|
'lifetime' => 0,
|
||
|
|
'path' => '/',
|
||
|
|
'domain' => '',
|
||
|
|
'secure' => $isSecure,
|
||
|
|
'httponly' => true,
|
||
|
|
'samesite' => 'Lax',
|
||
|
|
]);
|
||
|
|
session_start();
|
||
|
|
}
|
||
|
|
?>
|