Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running IIS v7 on a Win7 development machine. I have PHP code that saves session variables and calls them back later. This has been working on this machine for some time.

For some reason now, the session variables dissapear immediatly after saving. Code that used to work fine on http://localhost/, suddenly now does not.

I have tested different browsers - the vars dissapear regardless of browser.

I have tested identical code on different servers. The problem exists only on this development machine.

I tried some code that saves a session var, then reads it back and displays it, then shows a link to click on to read it back and display again. What happens is the session var DOES get written and read back and displayed ok. But when you click the link to view it again, it's gone.

I don't recall making any changes to IIS. But I did run several malware scanners and clean-up tools.

Is anyone aware of any setting in IIS that disallows session vars? Any other throughts?

share|improve this question

1 Answer 1

i suspect that you have not set the right permissions to the directory P:/PHP/Sessions.

the IIS process owner (usually IUSR_MACHINENAME) needs read, write and modify access to this directory.

also, of course, the share needs to be available when the script is running (if P is a mapped share and not a local drive).

lastly, in my php.ini files, even on windows, i always use a forward slash for directories.

CODE c:/windows/system32/drivers/etc

php shouldn't care. but I know that i fixed a bug once by doing this (i.e. unix style) and have therefore kept to the same rule ever since.

but the most likely issue is permissions across shares. of course (for an easy life) you should also make sure that if P is on a separate machine, they are also in the same AD forest or domain and the ACL.

share|improve this answer
    
in php.ini: session.save_path="C:\Windows\Temp" So, taking your suggestion, I tried giving read/write permissions to IUSR on that folder. That didn't fix the problem. However, the isuss is not isolated to PHP. The same thing happens with a classic ASP test. Which is why I believe the problem is IIS. Odd, the code was been working fine on this machine until recently. Anyone else with thoughts? –  John Feb 23 '11 at 22:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.