I want to store the created sessions in a directory above the root, except when I use any of the following:
session_save_path($_SERVER[\'DOCUMENT_ROOT\']
this works for me:
sudo chown -R www-data:www-data /var/lib/php/sessions
I use this to also make Named Pipes in php.
<?php
$user = get_current_user(); // get current process user
// We need to modify the permissions so users can write to it
exec( "chown -R {$user}:{$user} $fifoPath" );
Another solution: rename your session folder var/session to var/session_old
create a new folder var/session
and delete the old one.