In my company, we make login in one application (non-laravel). When the login is made, we store the session info in the $_SESSION variables, like $_SESSION['XPTO'].
The user has access to a lot of tools (all non-laravel) and we use everywhere the $_SESSION['XPTO'] to get the data that we need about the authenticated user.
The problem is that I developed a new tool with Laravel 5.3 and I need to get the data that is inside the $_SESSION variables. I think laravel do not use the native php sessions!
So, how can I get that information?
Thanks in advance
to access $_SESSION
, simply place session_start()
at the beginning of the index.php
file of your laravel-project
Laravel doesn't use native PHP sessions since Laravel 5.
We are no longer using Symfony's (and therefore PHP's) session handling facilities, and are using a custom solution that is simpler and easier to maintain
In Laravel you want to use Session::
facade or session()
global helper to work with sessions:
// Saving value.
session()->put('key', 'value');
// Gettinng value.
session('key');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With