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

$session->migrate() called before session is started #7

Open
pascal-hofmann opened this issue Sep 6, 2015 · 1 comment
Open

$session->migrate() called before session is started #7

pascal-hofmann opened this issue Sep 6, 2015 · 1 comment

Comments

@pascal-hofmann
Copy link

I think there is some kind of conceptual error (at least when session.auto_start=0). I was trying to use Stack\Session and always got an empty session ID.

Reason is, that $session->migrate is called when no cookie is present. This leads to a call to session_regenerate_id (which fails, because no session was started yet). Afterwards NativeSessionStorage::loadSession is invoked, which sets NativeSessionStorage::$started to true.

So in the end I have a broken session (empty session id). I could fix this, by adding a $session->start() before the call to $session->migrate().

@pascal-hofmann
Copy link
Author

Is there a reason for the call to $session->migrate()? I think just calling $session->start() should be enough. (Or maybe don't call anything in this case, and let the app start the session if it wants to).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant