session_start on IIS suddently stopped working

I have my php files on an IIS 8 server.
I put a session_start on the top of the page.

My code was working fine. I moved it to a new folder. It worked for 5 minutes, and then I got this error:

Warning: session_start(): open(C:\Windows\temp\sess_69voc1ru64hq9ipmqm8llpdqn4, O_RDWR) failed: Invalid argument (22) in \\19******de.php on line 3
Success
Warning: Unknown: open(C:\Windows\temp\sess_69voc1ru64hq9ipmqm8llpdqn4, O_RDWR) failed: Invalid argument (22) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (C:\Windows\temp) in Unknown on line 0

Open in new window


I set up a new folder, tried it there and it worked, and then 5 minutes later it started erroring again.

what can I do to make it work?
rivkamakAsked:
Who is Participating?
 
rivkamakAuthor Commented:
We had to restart our server and now it works fine.
0
 
Dave BaldwinFixer of ProblemsCommented:
Normally I would think it was a permissions problem but that should show up immediately.  I am suspecting that your anti-virus is deciding that what you are doing is "bad behavior" and blocking it after a little usage.

I have PHP in 'C:\PHP' so I create a 'save' directory for sessions info at 'C:\PHP\save\'.  Then I edit the permissions to make sure the IUSRS... and the IUSR users have read/write permission.  Then if I have to I will tell my anti-virus to stay out of that directory.
0
 
rivkamakAuthor Commented:
The real question is that is keeps going up and down. It doesn't work, and then suddenly it will start working again,
then 1 hr later all the pages go down again.
0
 
Dave BaldwinFixer of ProblemsCommented:
I think the 'real answer' is that your anti-virus is interfering.  The default for "session.save_path" is blank which make PHP use the Windows 'temp' directory.  Before your question, I had 4 Windows 7 computers using that without any problems.  I changed that because I didn't want my session data comingled with all that other stuff.
0
 
rivkamakAuthor Commented:
Nothing else worked
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.