I attached cookies to the responses.
My Laravel code.
return response('Hello World')->cookie('myCookieName', 'MyValue', 0);
Vue using this package https://www.npmjs.com/package/vue-cookies
console.log(this.$cookie.get('myCookieName'))
console result eyJ1c2VybmFtZSI6Inl1cmlpIiwiZnVsbF9.....
I'm expected the real value of my cookie. MyValue
How to decrypt or decode the value of cookies to get the real value in Vue?
CodePudding user response:
The App\Http\Middleware\EncryptCookies
middleware in Laravel allows you to set exceptions. Example:
/**
* The names of the cookies that should not be encrypted.
*
* @var array
*/
protected $except = [
'cookie_name',
];
For more info checkout the documentation.