xxxxxxxxxx
//remove single session
Session::forget('Sessionkey');
//remove multiple sessions
Session::forget(['sessionKey1', 'sessionkey2']);
//remove all sessions
Session::flush();
xxxxxxxxxx
// Forget a single key...
$request->session()->forget('name');
// Forget multiple keys...
$request->session()->forget(['name', 'status']);
$request->session()->flush();
xxxxxxxxxx
# ref: https://laravel.io/forum/02-06-2014-session-destroy
Session::forget('yourKeyGoesHere') // Removes a specific variable
xxxxxxxxxx
# ref: https://laravel.io/forum/02-06-2014-session-destroy
Session::forget('yourKeyGoesHere') // Removes a specific variable
xxxxxxxxxx
@if(Session::has('success'))
<div class="alert alert-success">
{{ Session::get('success') }}
@php
Session::forget('success');
@endphp
</div>
@endif
xxxxxxxxxx
use Illuminate\Support\Facades\Session;
// Clearing a specific session value
Session::forget('key');