PHP. Session in the database. Crossdomain authorization. Something I don't understand?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
26 views
Session stored in the database. Authorization common at 2 sites(2 domains, sites lie side by side on the same server). When the user is authenticated on one site, there is a redirect to the second, where session_name() registers the same value as on the first website (in the cookie). Table with session data are common for 2 sites.

On an old hosting all worked norms, the new — yet.

Problem description —

I've logged in from one site. Go to the second, from the database to retrieve data(read function), then all the rules. But right after session_start(), do print_r($_SESSION) and see an empty array. I.e., line gave, got ... got nothing. This happens only with data recorded on one site that I'm trying to read on another.

They found the data on the old host it was written in the form of serialized massive. Here — 'rJFJvf6LVaiQoSWdAHmIFSu5Zfx-393AnbN81sd2B5jmEeWlhKYJB_E9Lv93bjvw'. Can be in this case.


session.serialize_handler = php both hosting

php 5.2.4(old) / 5.2.14(new)

all the php settings the block session — the same.


Thank you!
by | 26 views

4 Answers

0 like 0 dislike
Option 1 — the evil and scary "Suhosin" encoder data session.
And please show the settings of read-write-start sessions
by
0 like 0 dislike
rJFJvf6LVaiQoSWdAHmIFSu5Zfx-393AnbN81sd2B5jmEeWlhKYJB_E9Lv93bjvw — it's more like the key than the data length = 64
by
0 like 0 dislike
It seems that php compiled with module enhance security, like Suhosin encrypts session data. And the encryption key depends on the domain. Try to disable all unnecessary modules.
by
0 like 0 dislike
and session_decode() decodes correctly this string?
by

Related questions

0 like 0 dislike
2 answers
asked Apr 1, 2019 by Ockonal
0 like 0 dislike
7 answers
0 like 0 dislike
4 answers
0 like 0 dislike
7 answers
110,608 questions
257,186 answers
0 comments
28,072 users