Hello! I had a problem: my session is closed after closing the browser. Why?. If I close the tab with the page where the session is set, the session does not end, but if I close the browser and re-enter that page, my session will close.
index.php
<?php session_start(); require_once 'includes/config.php'; ?> <!DOCTYPE html> <html lang="ru"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title><?php echo $config['title']; ?></title> <link rel="stylesheet" href="css/style.css"> </head> <body> <?php require_once 'includes/connection.php'; require_once 'includes/header.php'; ?> <section> <div class="container"> <?php require_once 'includes/slider.php'; ?> <br /> <br /> <div class="slider__films"> <input checked type="radio" name="respond" id="main"> <article id="slider__films"> <input checked type="radio" name="respond__slide" id="film__switch1"> <input type="radio" name="respond__slide" id="film__switch2"> <input type="radio" name="respond__slide" id="film__switch3"> <input type="radio" name="respond__slide" id="film__switch4"> <input type="radio" name="respond__slide" id="film__switch5"> <div id="films__slides"> <div id="films__overflow"> <div class="films__image"> <article class="article"> <div style="display: contents;"> <?php $db = new DB(); $db->requestPrepareFetchAll("SELECT film_name, film_small_img FROM new_film"); ?> <?php foreach ($stmt as $row): ?> <a href="films/<?php echo $row['film_name']; ?>.php"> <img src="<?php echo $row['film_small_img']; ?>" alt="" style="width: 100px;"> <p><?php echo $row['film_name']; ?></p> </a> <?php endforeach; ?> </div> </article> </div> </div> </div> <div id="films__controls"> <label for="film__switch1"></label> <label for="film__switch2"></label> <label for="film__switch3"></label> <label for="film__switch4"></label> <label for="film__switch5"></label> </div> <div id="films__active"> <label for="film__switch1"></label> <label for="film__switch2"></label> <label for="film__switch3"></label> <label for="film__switch4"></label> <label for="film__switch5"></label> </div> </article> </div> </div> </section> <script src="js/functions.js"></script> </body> </html> header.php
<?php require_once "config.php"; ?> <header> <div class="headerflex"> <a href="../index.php" class="logo"><?php echo $config['title']; ?></a> <div class="opencategory"> <img src="../img/movie-clapper-open.svg" alt="" class="menuimg" onclick="openMenu()"> <img src="../img/cancel-cross.svg" alt="" class="cancelcross" onclick="closeMenu()"> <a href="#" class="category">ΠΠ°ΡΠ΅Π³ΠΎΡΠΈΠΈ ΠΊΠΈΠ½ΠΎ</a> <ul class="headercategory"> <li> <a href="#">Π€ΠΈΠ»ΡΠΌΡ</a> </li> <li> <a href="#">Π‘Π΅ΡΠΈΠ°Π»Ρ</a> </li> <li> <a href="#">ΠΠ½ΠΈΠΌΠ΅</a> </li> <li> <a href="#">ΠΠΎΠΌΠ΅Π΄ΠΈΠΈ</a> </li> <li> <a href="#">ΠΠΎΡΠ²ΠΈΠΊΠΈ</a> </li> </ul> </div> <a href="#"><img src="../img/search.svg" class="searchimg" onclick="openSearchInput()"></a> <input type="search" class="search" placeholder="ΠΠΎΠΈΡΠΊ ΠΏΠΎ ΡΠ°ΠΉΡΡ"> <?php if (isset($_SESSION['user'])): ?> <a href="../includes/admin.php"><img src="../img/avatar.svg" class="avatar"></a> <?php else: ?> <a href="../includes/signin.php" class="acclink">ΠΠΎΠΉΡΠΈ</a> <a href="../includes/signup.php" class="acclink">ΠΠ°ΡΠ΅Π³ΠΈΡΡΡΠΈΡΠΎΠ²Π°ΡΡΡΡ</a> <?php endif; ?> <a href="#"><img src="../img/telegram.svg" alt="" class="telegram"></a> </div> </header> So the code is ironed during authorization 
So the code is ironed out during authorization but after rebooting the browser 
In php.ini
session.cookie_lifetime = 2678400 session.gc_maxlifetime = 2678400 What to do?