$value = Session::get('variableSetOnPageA');
$request->session()->put('key','value');
<!--This is placed in the view section --> {{ session('key_name') }}
$value = Session::get('key');
$value = session('key');
// Via a request instance...
$request->session()->put('key', 'value');
// Via the global "session" helper...
session(['key' => 'value']);
Session::put('key', 'value');
session(['key' => 'value']);
@if(Session::has('success'))
<div class="alert alert-success">
{{ Session::get('success') }}
@php
Session::forget('success');
@endphp
</div>
@endif
$data=[
'name' => $request->input('name')
];
session(['data'=>$data]);
$data=Session::get('data');
$data1=[
'email'=>$request->input('email')
];
$data=array_merge( $data, $data1);
session(['data'=>$data]);
session()->regenerate();