Notifications
Clear all

[RESOLVED] Problems saving sessions with PHP v5.2 specifically

1 Posts
1 Users
0 Reactions
1,540 Views
(@purpleyin)
Posts: 16
Active Member
Topic starter
 

URL to your eFiction: http://www.primevalarchive.co.uk
Version of eFiction: 3.5.3
Have you bridged eFiction, if so with what?: Yes, flashchat
Version of PHP: 5.2
Version of MySQL: 5.5.32
Have you searched for your problem: yes
If so, what terms did you try: captcha, sessions
State the nature of your problem: Session variables don't look like they are being saved
Do you have a test account for us? No

My site has a number of issues that, from reading on the threads I found with the search terms, point to session variables not saving. The reported issues are:
1. captcha forms (like on contact us, shoutbox) do not accept the correct answer
2. when not logged in users being prompted to confirm their age before reading age restricted stories see it loop back to warning when they confirm their age as old enough
3. users trying to move to chapters other than the 1st chapter has it loop back to first chapter instead of displaying 2nd/3rd/nth chapter
4. users logging in find themselves not logged in anymore (complete with skin prefs ignored) when moving away from the account page you are redirected to when you login, unless they tick 'Remember me' box when logging in

After reading up on this I tried Tammy's fix to button.php mentioned in another thread, no luck there, and then asking my hosting people to check my session variables were saving okay. They confirmed there was an issue with the path and have claimed it is now fixed. However the problems are still occurring except for issue 3, which I hadn't managed to reproduce myself anyhow so may be unrelated.

One thing I have figured out is that these did not start until after I upgraded my PHP version from v4 to v5.2 so I tried reverting back to v4 and sure enough the captcha was working on that just now. However, I had to go back to 5.2 as one of my other sites requires it, which leaves me with my issue and trying to figure out what is going on. I also tried updating to PHP v5.3 but that did not help. Could there be something I need in my 5.2 php.ini file that I am missing? I know very little of sessions so I'm a bit lost what else I should be trying here.

UPDATE: I actually managed to fix this myself, or so it looks so far. *fingers crossed*

I read up on php.ini files a bit more and after fiddling around, set the file back to my hosts default That also meant I needed to set the save.session_path again and I noticed there are two places it can be set. The first looked like it related to 4.0 (backwards compatibility?) and was what the hosting had set for me when I'd looked in the file before, but further down the ini file there was another instance it could be set. I still don't know quite what the difference between those two instances are, but setting it in the 2nd instance to my document root path /cgi-bin/tmp and saving the ini file then fixed all the problems I'd had.

Makes me think my hosting support are muppets, as they couldn't get it right where as I finally managed after about an hours reading up and trying my not that knowledgable attempts. I think the lesson here is if you have problems with your sessions don't trust your hosting to have set the path correctly!


 
Posted : 21/11/2013 1:47 pm
Share: