I try to do the following:
ini_set('session.save_path', '/var/www/example/sessions');
session_start();
but I get the following error:
session_start(): Session data file is not created by your uid
I check get_current_user() in returns vagrant
I check permission of /var/www/example/sessions it returns:
drwxrwxrwx 1 vagrant vagrant 4.0K Dec 11 01:58 sessions
Note: the answer stated here does not work for me because doing:
chown -R www-data:www-data /var/www/example/sessions/ returns an error:
chown: invalid user: ‘www-data:www-data’.
In Vagrant, it appears vagrant is the PHP user.
Note: The session files appears to get created inside the custom session folder but they are empty. e.g., sess_k92fdn46onm5an0mau6p50tr2g doesn't contain anything.
Any ideas?