P4tr1ck Posted August 9, 2006 Posted August 9, 2006 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? Quote
TCH-JimE Posted August 9, 2006 Posted August 9, 2006 Welcome to the forums P4tr1ck, If you believe this to be s server problem, please start a support ticket and ask the server guys to take a look at the setup (remember to point out it works on the other server) Other then that, are you sure there is nothing else conflicting in the account, e.g. htaccess or web direct? JimE Quote
TCH-Don Posted August 9, 2006 Posted August 9, 2006 Welcome to the forum, P4tr1ck I agree, check your .htaccess file. Quote
P4tr1ck Posted August 9, 2006 Author Posted August 9, 2006 Ya, it ended up being something in my .htaccess file. Thanks guys. Quote
TCH-Don Posted August 9, 2006 Posted August 9, 2006 Glad you got it working Thanks for the update. Quote
TCH-JimE Posted August 10, 2006 Posted August 10, 2006 Glad its working! Htaccess is very powerful but can scupper the best laid plans of any website! JimE Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.