dalecosp;10967501 wrote:if it fails, loop through an array of likely names. /tmp, /var/tmp, c:\windows\temp, and %userprofile%\appdata\local\temp might be enough....
Eh... I disagree. For one, there's no need to blindly "guess" at the correct path - there are environment variables available to tell you where to find the system's default temporary directory.
However, PHP will automatically set session.save_path to point to this temp directory on its own, so if the server operators have specifically altered that, then it must be for a reason (e.g. the user is supposed to store the files in his/her own home directory (above the web root, of course)). In other words, if the session.save_path isn't valid, then the best solution would be to prompt the user for a new location to save the session files.