View Full Version : Seemingly simple: session variables not getting passed on

03-09-2008, 04:07 PM
I've got a very simple session problem but can't seem to figure out what's wrong:

here's the index page:

<?php session_start();

$_SESSION['uid'] = $username;
//some stuff below

and on the next page:

<?php session_start();

Simple as that. But on the next page $_SESSION is empty.

My php.ini has:

session.auto_start: Off
session.use_cookies: On
session.use_only_cookies: Off
session.use_trans_sid: 0

On my local machine this works fine, but on the server I'm developing (which has the same config in php.ini), variables just don't get passed on.

Is there something else I should be looking at? The only thing that strikes me as different from my local machine settings is that the server's running IIS. That can't be the problem but I can't think of anything else..

03-09-2008, 04:23 PM
It is highly likely an error is occurring, but is hidden due to the display errors or error reporting settings. Add the following two lines after your first opening <?php tag (put the <?php on its own line, then add these two lines after that, then put your session_start() statement) -

ini_set ("display_errors", "1");

03-10-2008, 08:51 AM
oh wow.

Warning: session_start() [function.session-start]: open(C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\php\session\sess_kp0cceqsapmcp367jk5vttv072, O_RDWR) failed: Permission denied (13) in ....

thank you! :)

03-10-2008, 10:19 AM
Ok, I went to that folder (C:\Documents..............\session), gave read/write permissions to the website and refreshed the site on IIS - no change. It still has that O_RDWR fail.

Actually, it's working now.. thanks :)