Yitzhak
Yitzhak

Reputation: 561

Something is wrong with sessions, never seen this one before

Yesterday, the I'm doing some work for had their website on one server. Everything worked fine. This morning I woke up, and my password didn't work. Got the new password from IT, and started hacking away at code.

Then I start getting these oddball errors. For example, I can login to an account, which stores an array of data in a session in php.

Here's where it get interesting.

If I had a session that was $_SESSION['attributes']['ID'], I could print it out, and get the value from it. But, when I try to evaluate against it, I'm always getting false as the return value, even when I assign it to a variable, like $x = $_SESSION['attributes']['ID'];

It's doing this across the entire system. Stuff that passed through Q/A weeks ago, and new stuff alike.

What the hell?

I've got root access, so I can fix it if it's a php.ini issue. I just don't know where to look.

Have you ever seen this before?

Upvotes: 2

Views: 74

Answers (1)

2ndkauboy
2ndkauboy

Reputation: 9377

Maybe the same issue I had some weeks ago: I was able to stote data into a session and I was able to read those values in the same execution of the script. But an each reload of the script, the data was missing.

The simple, yet hard to find error:

The session.save_path has become unwritable for the apache user by some odd server process one of the admins was running each night (setting the owner of the folder to root).

I simply changed the path to the upload_tmp_dir (just in case the same admin is doing the same stupid misstake again) and the session text files could be successfully stored on the hdd again.

P.S. I couldn't find it the first place as the cookie was send successfully and the initialization also worked just fine. But as PHP was unable to write the session data to the disk, all "saved" data was lost after the script died.

Upvotes: 1

Related Questions