I am using Macos built-in Apache server locally for development. I have developed a site which uses PHP and relies on session cookies to persist sessions. With the default Apache setup, everything was working fine, and session data was persisted correctly.
For ease of development, I wanted to change the User and Group in Apache to my username and group. I did this by editing /etc/apache2/httpd.conf, per instructions I found on the net. Restarted Apache, and every thing seems to work fine - <?php print `whoami` ?>
shows the expected username (mine.)
HOWEVER, I have now started observing that the $_SESSION variable is no longer persisted.
I grepped /etc/php.ini to see if there was a line which included '_www' (the default Apache user and group) thinking that the PHP config had to be changed also to sync things up. However grep returned no lines as such.
Anyone know what is going on here, and how to fix this?
EDIT: I have checked session ids session_id()
and verified that the same session ids are being used between pages.