set session in laravel controller code example
Example 1: set session in laravel
Session::put('variableName', $value);
Example 2: laravel get all session data
$data = $request->session()->all();
Example 3: import session laravel
use Illuminate\Support\Facades\Session;
Example 4: laravel session put method
Session::put('key', 'value');
session(['key' => 'value']);
Example 5: laravel get session variable in controller
$value = Session::get('variableSetOnPageA');
Example 6: session laravel
session(['name' => 'data']);