2

now I have an error in Magento 2 that shows this error:

There has been an error processing your request

Warning: Cannot use a scalar value as an array in /home/web/domains/web.com/public_html/vendor/magento/framework/Session/SessionManager.php on line 492

Do you know how to solve this? I use Magento 2.3.5

4

Its a bug just change the line 492 with this

do you see this line

Replace this

protected function _getHosts()
    {
        return $_SESSION[self::HOST_KEY] ?? [];
    }

with this

protected function _getHosts()
    {
        
       return isset($_SESSION[self::HOST_KEY]) ? [$_SESSION[self::HOST_KEY]] : [];

    }
8
  • Hello, I have this in my 492, I replace with your code? $hosts[$host] = true; Thanks
    – Carlos
    Aug 3 '20 at 9:20
  • check updated ans
    – Pramod
    Aug 3 '20 at 9:35
  • Thanks! I have edited :)
    – Carlos
    Aug 3 '20 at 9:42
  • is it working ?
    – Pramod
    Aug 3 '20 at 9:42
  • I don't know as I cleared cookies before from the internet browser and was ok, for now I don't see the error
    – Carlos
    Aug 3 '20 at 9:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.