Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Something wrong with session. It can't start. #13254

Closed
avitruk opened this Issue Jan 14, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@avitruk
Copy link

avitruk commented Jan 14, 2018

Expected and Actual Behavior

Hi to all.
My project was works perfect on php 5.6 + phalcon 3.1.2 (locally).
But after updating to phalcon 3.3.1 and PHP 7.2 I started to receive the error "Invalid superglobal". Here on the github I found several similar topics, from where I learned that the error is related to an un-started session. It's strange because I start the session in service registration:

$di->set('session', function () {
            $session = new SessionAdapter();
            $session->start();
            return $session;
        }, true);

I thought that I fixed the problem by changing the configuration of the PHP in php.ini

session.auto_start = 1

But now there is new error: I have a blank screen on redirects e.g:

return $this->response->redirect('account/sign-in?next=' . $url);

And there are no any php errors. Errors log clean.

And at this moment:


$session = $this->di->get('session');
var_dump($session->isStarted()); // -> returns false

if (session_status() == PHP_SESSION_ACTIVE) { // -> returns true
      var_dump('session started');
}
//...
return $this->response->redirect('account/sign-in?next=' . $url); // -> redirect didn't work

XDebug di-dump at this point: link
If I tried to start session via php session_start() I receive error, that session is already started.
So why phalcon session can't start even if it was started manually in service registering.

How to debug it? What additional information shoul I provide?

Also the project works fine on macOS with php 7.2 and Phalcon 3.3.1 So I assume that the problem with
win-version.

Details

  • Phalcon version: 3.3.1
  • PHP Version: 7.2
  • Operating System: windows
  • Installation type: .dll
  • Server: Nginx or Apache
@sergeyklay

This comment has been minimized.

Copy link
Member

sergeyklay commented Apr 14, 2018

@sergeyklay

This comment has been minimized.

Copy link
Member

sergeyklay commented Apr 25, 2018

Fixed in the 3.4.x branch. Feel free to open a new issue if the problem appears again. Thank you for contributing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.