Answers for "laravel get cookie value"

PHP
1

setcookie in laravel 8

Cookie::queue(Cookie::make('name', 'value', $minutes));

Cookie::queue('name', 'value', $minutes);
Posted by: Guest on September-28-2020
0

laravel get cookie value

// This is a little messy, but works with update in 2020
// see security note: https://blog.laravel.com/laravel-cookie-security-releases

use Illuminate\Support\Facades\Crypt;

$hmac_prefixed = Crypt::decryptString(request()->cookie('cookie_name')) // result "a86aa854d5e61e2873acd30373b6725e36fba671|cookie_value"
$cookie_value = explode("|",$hmac_prefixed)[1];
Posted by: Guest on August-24-2021

Browse Popular Code Answers by Language