use Illuminate\Http\Request; $request = Request::capture(); if ($request->hasCookie('username')) { $username = $request->cookie('username'); echo 'Hello ' . $username . '!'; }
use Illuminate\Http\Request; $request = Request::capture(); if ($request->hasCookie(['username', 'remember_me'])) { echo 'Both cookies exist'; } else { echo 'At least one of the cookies is missing'; }This code example is from the Laravel Framework's HTTP package library.