I have a PHP script which uses session_start(); which works perfectly on linux server. However, when I try the same script on windows server, I run into permissions problems, presumably on the /tmp directory. I can get round the problem by first creating a ‘session’ directory just above wwwroot level and then using:
session_save_path(‘…/…/session’); // from a sub-directory in the main web, and then:
session_start();
In the PHP info file, session support is enabled, but session.auto_start is off - could this be the reason?
Unfortunately, I don’t have that kind of access to the server. However, if I first detect whether the server is windows and then, if it is, use my workaround. This seems to be adequate for my purposes. I think I’ll leave at that. Thanks anyway.
Regardless of what server you are running on, it is always a good idea to create your own temporary directory for your site (or on a per site bases) this will keep your temp files and session files away from other people/site’s temp files and session files. Less chance of mix ups, or premature clean up.