PHP empty session files generated

50
February 12, 2019, at 2:20 PM

I have a site where I use session authorization for my users Details are:

PHP Version 7.2.8
session.gc_maxlifetime  604800
session.gc_probability  1
session.gc_divisor  1000

I use the following db.php file for creating a session

$dinamo_session = session_name("dinamo_session");
ini_set('session.cookie_domain', '.DOMAIN_NAME'); 
#if (isset($_REQUEST[session_name("dinamo_session")])) {
    #ini_set('session.cookie_lifetime', 604800);
    #ini_set('session.gc-maxlifetime', 604800);
    #ini_set('session.save_path', '/var/www/user9357/data/_SESSIONS');
    session_start();
    #session_regenerate_id(true);
    #session_write_close();
#}

My users do not complain from their end everything seems to be ok, the only thing is that I see a growing amount of session files with zero sizes (as well as I see normal session files with the real session's data) You can see different lines of code are commented out. I tried to use all of them to avoid creation of these zero size files but that did not help (isset - to check if the session has been created before, session_regenerate_id(true) - to delete the old files) but no luck. I even had to comment out isset as some users complained that they were not able to log in. I also checked that: Opera and Firefox were ok, but Vivaldi browser was not able to login

Any ideas why these zero files are created and how can I stop it?

READ ALSO
Change PDO login script to MySQLi

Change PDO login script to MySQLi

I have a problem because I don't know how I should change the ready-made login script with PDO to MySQLi ? Rest of my website is coded in MySQLiBelow its my config file

29
Yii2's mongodb collection - get all content of nested arrays

Yii2's mongodb collection - get all content of nested arrays

I have a Yii2 mongodb's collection that looks like this:

54
Mysql subquery or something better

Mysql subquery or something better

I am somewhat new to mysql and I am having an issue on how I should best write the following querySay I have a table that has a datetime column as well as a few others I want to search on

46
How to insert data into two tabels?

How to insert data into two tabels?

I have two tables FILM(Id, Title, Director, Year, Category) and Record(Id, Film_id)

48