A
A
Ainur Shakirov2016-04-21 19:33:16
PHP
Ainur Shakirov, 2016-04-21 19:33:16

How to fix session persistence in php7?

In general, updated on the php server to the 7th version. Speed ​​pleased. Of course, a lot of errors appeared, I'm slowly fixing them, but there is one gag:
Nothing is saved in $_SESSION. More precisely, it is saved, but only in the current function. Ie:
step 1) We write to the session, we deduce from the session. OK! It came out.
step 2) Just exit the session. There is nothing. Empty.
Where are the legs from? The admin says that everything is set up correctly, the problem is on my side, but I've been fiddling around for half a day.
I didn’t find any updates regarding sessions in the php7 docks (
PS everything works correctly on php 5.5.
session.save_path is the same for 7 and 5.5 (there are several versions at once, you can switch)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Ainur Shakirov, 2016-04-22
@Fqyeh29

Ultimately, the admin is to blame. Not me. Solving the problem (for those who came here from the search)

php_value session.save_handler files
php_value session.save_path /tmp/php_sess

In this case, there was a problem that, by default, sessions are stored in radish, but in php7, saving sessions in radish does not work correctly. I redirected the saving of sessions to a file, after which everything worked correctly.
Why saving sessions does not work in php7 has not yet been figured out, either there is no support for this functionality at all, or our assembly does not have this support.

#
# artur #, 2016-04-21
@passshift

Maybe it will help, like the same question is being discussed if I understand correctly
https://bugs.php.net/bug.php?id=70013

V
Vanya Zyuzgin, 2016-04-21
@site2life

Look at the PHP logs. Most likely a problem with the rights to the directory where the sessions should be placed. The user running PHP as may not have write permissions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question