I was able to create sessions on 3 days ago. The code remained unchanged. But now I can't create session. Error Message: Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (c:\web\dev\session) in Unknown on line 0
.
If I copy the path c:\web\dev\session
into windows run command, it opens the path so I have verified that the path exists. I also get the error: Warning: session_start(): The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in C:\Web\dev\backdoorequest.php on line 10
but I don't specify the PHP ID.
My code looks like this:
$user_row
is a array with all the users data for the session in it.
session_save_path('c:\web\dev\session');
session_start();
$_SESSION['user'] = $user_row;
$_SESSION['security']['ip'] = $_SERVER['REMOTE_ADDR'];
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$_SESSION['forwarded_for'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$_SESSION['security']['forwarded_for'] = false;
}
I'm using Apache 2.4 and PHP 5.6
I have seen this link but it only seems to resolve the issue if you are using IIS. I can't seem to find the solution with Apache.
I have also tried to remove the .htaccess file from my root directory.