The internal server serves two different applications for users on our local network:
https://10.0.0.100/app1/ https://10.0.0.100/app2/
Both applications are served by the same Apache configuration file, they are only in separate directories under public_html . Both applications use PHP sessions, but both of these $_SESSION prefix variables have a namespace:
$_SESSION['app1_favorite_colour'] = 'Yellow'; $_SESSION['app2_quest'] = 'Agghhh!';
Despite this, users who logged into app1 do not have their app2_ session data written to the session file on disk . Consider page1.php :
<?php session_start(); $_SESSION['apps_been_here'] = 'Yes!'; echo "<a href='page2.php'>Clicky</a>"; ?>
Then on page2.php :
<?php session_start(); echo "Have you been here: {$_SESSION['apps_been_here']}";
This means that it does not print βyesβ to the user if the user also logs into application 1! However, users who do not use app1 do look yes at page2.php . While researching, I opened the session files in /var/lib/php/session/ . I see only the variables in this file that start with the app1_ prefix and not one that starts with app2_ for users who are logged in to application1. Other users who are not logged in to app 1 have variables that start with app2_ in the session files!
I checked with lsof that the files were not locked, and I confirmed that the browser does not have open browser windows with app1 pages. Why can't App2 session variables be stored in a session file? There is a lot of free space on the disk and on the hard disk, and the processor load is less than 0.1 (measured using uptime ). The problem occurs for multiple users in multiple browsers (Firefox, Chrome). Clearing browser cookies and cache cookies does not help.
source share