My sessions were working fine while running my site on my own computer (PHP 4.4.2, though I'm quite sure the version difference is not a problem).
When I got the site up on TotalChoice, I noticed that my sessions weren't quite working (the $_SESSION global was an empty array, after having been set in a login page). After doing some testing, I found that this only occurred in my index.php page in the root public_html directory. I could create another, simple php file to test the session, and it would work fine.
So, you would think its something in my index.php code. Well, I copied index.php and renamed the file to something else. The session worked fine with this renamed file, with the exact same code. I then created a very simple script to test a session involving a page that would set a session variable, and another page that would display it. It works fine, unless the displaying page is named index.php, in which case I get the same problem. When I pass the session id to my index.php page in the url, I get the following error:
Warning: Unknown(): open(/tmp/sess_8e88a1a24b5744c1f7e488d6becb3cea, O_RDWR) failed: Permission denied (13) 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 (/tmp) in Unknown on line 0
I decided to test this on another TCH account I have, and I encountered no such problem while using that account. So to sum up: trying to start sessions in a file named 'index.php' or 'index.html' on this account does not work, for whatever reason php is not able to access the session save path while running a script by that name in the public_html directory. I realize that the simplest solution would be to just use a different filename, and that is probably what I'll have to do for now, however that's not the most conveniant solution, and this is an odd problem that I would like to truly fix.
Any ideas?