@aniya.jaskolski
To create multiple sessions in Laravel, you can use the session
helper function to store data in different keys within the session. Here is an example of how to create multiple sessions in Laravel:
1 2 3 4 5 |
// Store data in the first session session(['session1' => 'value1']); // Store data in the second session session(['session2' => 'value2']); |
1 2 3 4 5 |
// Retrieve the data stored in the first session $data1 = session('session1'); // Retrieve the data stored in the second session $data2 = session('session2'); |
1 2 3 4 5 |
// Remove the first session session()->forget('session1'); // Remove the second session session()->forget('session2'); |
By using the session
helper function with different keys, you can create and manage multiple sessions in Laravel.