laravel session clear code example

Example 1: laravel clear cache

php artisan cache:clear
php artisan route:clear
php artisan config:clear 
php artisan view:clear

Example 2: laravel destroy session

# ref: https://laravel.io/forum/02-06-2014-session-destroy

Session::forget('yourKeyGoesHere') // Removes a specific variable

Example 3: laravel clear page cache

php artisan cache:clear

Example 4: session flush laravel

// Forget a single key...
$request->session()->forget('name');
// Forget multiple keys...
$request->session()->forget(['name', 'status']);

$request->session()->flush();

Example 5: how to clear session in laravel

# ref: https://laravel.io/forum/02-06-2014-session-destroy

Session::forget('yourKeyGoesHere') // Removes a specific variable

Tags:

Php Example