Jump to content

Recommended Posts

Posted

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?

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...