vendredi 17 juin 2016

Missed session variables when redirecting page

I have a problem regarding sessions in Laravel. I try to redirect the page and at the same time sending some session variables using the with() method:

return Redirect::To('/')->with('foo','bar');

But when the page comes up, the only session variables set are _token and locale, 'foo' and 'bar' do not appear. Running {!! var_dump(Session::all()); !!} gives:

array(2) { ["_token"]=> string(40) "l5NawtJdHJtanTErsya440UvPQIgqNExiryJIkIO" ["locale"]=> string(2) "se" }

The session stored in storage/framework/sessions strangely has other variables set, such as url and PHPDEBUGBAR_STACK_DATA that don't show up when redirecting.

Now, here's the real twist: It works perfectly when run on a different computer.

We tested with the same repository, same code, a fresh installation of laravel, same web browser, same OS and same program for running the server locally. On another computer it works fine, and on a third computer, but not on mine.

The application is in debug mode and I have tried clearing all caches in Laravel and nothing changed.

Does anyone have a clue on how this can be resolved?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire