Is there a way to determine a * actual * path save session?

I know that there are half a dozen ways to get the value of the session.save_path directive ( phpinfo() , session_save_path() , etc.), but when this value is an empty string, like this is the default, the actual path can be in any of several places. I read that usually /tmp , except when it is /var/lib/php5 , but on OS X Mountain Lion it is definitely /private/var/tmp . On Windows it is possible C:\Windows\Temp , but who knows.

I could indicate the location, but that will not help me. I am trying to diagnose a complex problem, and I would like to know what the current location on the server is, to which I do not have full access. If there is a right way to do this, I could not find it. I am open to smart hacks.

+8
php session
source share
1 answer

I have not looked at the PHP source code to confirm this, but it looks like when session.save_path empty, PHP uses the sys_get_temp_dir() value (which is user dependent).

+4
source share

All Articles