I need some help regarding on how Laravel manages sessions. When I was programming with pure PHP, i was using the global variable $_SESSION. This way, when I wanted to retrieve information regarding an user, I was finding the user in the database by $_SESSION['id'] variable. I do not understand how Laravel works with this. Can you guide to some guides, please? Thanks in advance.
As pointed in the first comment, Laravel has it's own Session controlling system, that can be accessed, at any point of your application, by using the Session
facade.
To store a value in the session, you do
Session::put('key', 'value');
To retrieve the value:
$value = Session::get('key');
Besides reading documentation, you have to know that Laravel has dedicated Session class. By using that class at different points in Laravel request you can track users activity (among others thing that can be done). There is very interesting session/code flow from initial request to response so take a look - that is the best way to learn.