The goal is to create a repository of a custom session files. When I use this code to write data to a session file, php creates two files with different names but with the same content. Why is this happening?
$uniqFileName = sha1(uniqid('', true)) . '.sess';
$path = '/storage/sessions/';
$sessionContent = ['name' => 'SomeName', 'age' => 'SomeAge'];
file_put_contents($path . $uniqFileName, serialize($sessionContent));
This creates two files at a time with the same content:
0b2399001549e543d067ea28c6561a1b752f58a9.sess
685fcb86fc7310d58e1154ca6b6d029630bb6d56.sess
The contents of both files:
a:2:{s:4:"name";s:8:"SomeName";s:3:"age";s:7:"SomeAge";}
It is understood that this will be a class, but the code works the same way in the context of the class and in index.php.