I am using session_save_path() to save session data into a file.
The problem I am getting though is that I am getting this warning in my Test1.php file:
Warning: Unknown: open(Session//sess_f3n6jeu79lsq91s9romabg1752, O_RDWR) failed: No such file or directory (2) in Unknown on line 0 Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (Session/) in Unknown on line 0
What I have done is create an init.php and place the code below in this file:
<?php
session_save_path('Session/');
?>
Then in the Test1.php file I included this code:
<?php
ini_set('session.gc_maxlifetime',12*60*60);
ini_set('session.gc_divisor', '1');
ini_set('session.gc_probability', '1');
ini_set('session.cookie_lifetime', '0');
require_once 'init.php';
session_start();
...
?>
In my directory it looks like this below:
Session (Folder)
init.php (file)
Test1.php (file)
What am I doing wrong? Is it the session_save_path where I am going wrong?
Look at the warning:
There is a ‘/’ to much. The correct path is:
Make sure the webserver process has access to the folder.
Either the webserver process must be owner of the folder and permissions 700 or webserver process is not owner of the folder, permissions then 777!