Сессия работает неправильно на PHP 7.3, но отлично работает в 7.0.Php

Кемеровские программисты php общаются здесь
Ответить Пред. темаСлед. тема
Anonymous
 Сессия работает неправильно на PHP 7.3, но отлично работает в 7.0.

Сообщение Anonymous »


I'm having trouble with a login system using PHP. I have a file called session.php which I include inside another PHP file called index.php.

This is the code inside:

It works fine in my machine using XAMPP with PHP 7.3. If I upload it to an apache server with PHP 7.3 (as well) and go into index.php;

I then check the value of $user and it's NULL.

However if I switch to PHP 7.0 it works just fine and $user is now an object as it should be.

I need to use PHP 7.3 because of compatibility with a library.

Also, if you go to the session.php file directly instead of including it from another file it works fine (even with PHP 7.3).

I've tried:
  • Putting the session_start() bit inside the index.php at the start of the file.
  • Making index.php content nothing but `include 'session.

But got nothing.

Also, I don't have access to the logs so I can't check there.

I tried var_dumping stuff to see if the session.php file is being called at all and up until the if(isset($_SESSION['myweb-login'])){ line it shows stuff but nothing after...


Источник: https://stackoverflow.com/questions/570 ... ine-in-7-0
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение
  • Сессия прерывается при использовании mod_rewrite и не переходит в index.php
    Anonymous » » в форуме Php
    0 Ответы
    18 Просмотры
    Последнее сообщение Anonymous
  • Сессия прерывается при использовании mod_rewrite и не переходит в index.php
    Anonymous » » в форуме Php
    0 Ответы
    16 Просмотры
    Последнее сообщение Anonymous
  • Сессия прерывается при использовании mod_rewrite и не переходит в index.php
    Anonymous » » в форуме Php
    0 Ответы
    16 Просмотры
    Последнее сообщение Anonymous
  • PHP-сессия уничтожается при перенаправлении
    Anonymous » » в форуме Php
    0 Ответы
    6 Просмотры
    Последнее сообщение Anonymous
  • PHP - Грязная сессия чтения. Не уверен, какие шаги предпринять
    Anonymous » » в форуме Php
    0 Ответы
    5 Просмотры
    Последнее сообщение Anonymous

Вернуться в «Php»