PHP unexplained session behavior
I'm currently experiencing a problem using sessions under php 4.4.2. I store variables and objects inside session variables, and all works well under php 5.x, but when I upload those pages to my hosting (tiscali italia business) the whole site and session variables seem to work at the beginning, but after a variable number of request (sometimes the second, sometimes the fifteenth page requested) all the site get stuck, every request from the site domain 'hangs up' from this moment.
But the site isn't really stuck, any request to a page (plain html or php+html) that not use sessions (without session_start()) works well and these type of pages are sent to browser.
If I make requests from another browser, but from the same host, or if I switch to another client host, a new session is created, I can navigate through a few pages and after some requests I experience the problem again.
Notice that after about thirty minutes (a sort of timeout?) I can navigate again from this host+browser.
So, after these tests, I'm pretty sure that the problem is caused by some stranges behaviours of sessions, but I don't know if I didn't consider some hosting provider's php.ini session settings, or if it could even be a bug or an unexpectedly weird handling of session variables.
THE WORKAROUND:
I wrote from scratch a little class for session handling.
It stores serialized variables on files in a temporary path, using a cookie to store the sessionid generated at the initialization of my class. That's quite exactly how does php manage session. You can find quick usage infos inside the class file itself.
here's the source, if you might find it useful post a comment (no registration needed).