Page 1 of 1

$_SESSION Variables on IIS

Posted: Wed Oct 31, 2007 2:10 pm
by dwessell
Hi,

I've just installed php on a IIS server..

The script calls the variable:

$_SESSION['valid_user'].. However, it always is returned as empty.. Code functioned just fine on a Apache server.

Is there something special that needs to be done during the installation? I'm running IIS 6 and PHP 5.2.4...

THanks
David

Posted: Wed Oct 31, 2007 2:26 pm
by Zoxive
The server probably had Session's Autostart.

Try putting session_start() at the very top of each page that uses session variables.

Error_reporting helps too, then you would see you are getting errors.

Posted: Wed Oct 31, 2007 2:30 pm
by dwessell
Hi Zoxive,

Thanks for the information.. I just found the error as your note came in..

In php5 installations on IIS6, the default session.save_path variable will NOT function unless you adjust the permissions of the dir, or change it to the old setting of c:\temp..

Wish that had been in the installation manual somehwere :) would have saved me hours..

Thanks
David