IIS 7 and Above
IIS7 / PHP FastCGI - session_start() problems - specific to Internet...
Last post Aug 13, 2010 10:45 AM by davidoff69
Aug 13, 2010 10:39 AM|davidoff69|LINK
I've encountered a strange problem which I have yet to solve, and that is so far driving me up the wall. I'm hoping someone out there can help as I have already spent all morning trying to resolve it without success.
I've set PHP 5.2.10 up on IIS using the msi package, and created a basic website to use for testing. All seems well when browsing a test site in firefox, safari, and opera, its only in IE8 that this is happeneing - every page load is generating a new session.
It's as though IE8 is blocking the cookie.
I've checked the secuirty setting in IE - shouldnt really be a problem as this is an intranet site, so first party cookies should be allowed by default.
This is not the only IIS server on our network, and the sites that we have hosted on an alternate IIS7 server are all behaving fine in terms of session cookies. I remember I set that server up manually rather than using the msi, that appears to be the only
difference as I have mirrored the php.ini from one server to another.
I just cant understand why PHPO isn;t picking up the session cookie. Each time I call session_start() I can see that a new session is being egereated, and I can store and retrieve from $_COOKIE within the page as it loads. It's only when the page is refreshed
that session_start() creates a new session.
I can see the sessions as they are created in the session.save_path that I've specified in my php.ini. Lets say I refresh the page 5 times, 5 individual session_id's are created, and 5 corresponding session files in the save path. I do the same in any other
browser than IE and only one session file is created - and any data stored in that is preserved when the page is reloaded.
Can anyone explain this as I've at a loss at the moment.
Aug 13, 2010 10:45 AM|davidoff69|LINK
Resolved this - it was beacuse there was an underscore in the hostname. The minute I removed the offending _ the thing started working. Just means that now I have to remove them all!!!!!
Hope this helps someone else.