3

I am pretty new to Laravel 5 and I'm trying to store some variables in session to use them on other pages. The problem is that everytime I go to another page or I refresh the page, the session is empty. I tried using Session::get('key'), I tried using session('key') as Laravel documentation says, I tried with $request->session()->get('key') and finally I tried ussing my own session handler which is assigning values directly to global $_SESSION variable, but no result.

I tried the solution from this thread, but when I refresh my page, session is empty. It work fine just if I assign a value right before I use it.

What am I doing wrong?

Community
  • 1
  • 1
  • look, the problem is not in laravel. it is in your code. create an http://stackoverflow.com/help/mcve and post it here. No one can tell what you are doing wrong if they have no idea what you are doing – Raj Kamal Feb 05 '16 at 04:38
  • @RajKamal sorry, I had many code samples and didn't know which one to post here – Calancea Bogdan Feb 05 '16 at 12:28
  • @ThomasKim Thanks a lot! The problem was solved moving my routes to the web middleware. I think that was the only thread that I missed on Laravel and session.. – Calancea Bogdan Feb 05 '16 at 12:30

0 Answers0