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::keep() sometimes causing error: array_merge(): Argument #1 is not an array #2217

Closed
matthewgoslett opened this issue Sep 3, 2013 · 1 comment

Comments

@matthewgoslett
Copy link

I'm not 100% sure this is the cause for this but I'm able to replicate by doing the following:

  1. User was logged in previous day.
  2. The user loads a page the following day but is not logged in yet, although I suspect the remember me cookie triggers a login at this point.
  3. I call a Session::keep(array('_old_input', 'errors')); on this first request.
  4. Session:keep() calls $this->mergeNewFlashes($keys);
  5. In mergeNewFlashes(), the line $values = array_unique(array_merge($this->get('flash.new'), $keys)); causes an error:

array_merge(): Argument #1 is not an array

If I var_dump the output of $this->get('flash.new'), the value is NULL

If this is indeed the issue, would changing $this->get('flash.new') to $this->get('flash.new', array()) not fix the this?

@taylorotwell
Copy link
Member

Fixed. Thanks.

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

2 participants