How to read laravel_session cookies stored in browser cookie memory on client side?
As mentioned by @AlexSlipknot. You need to change the setting to allow JavaScript to access cookies.
Change the value to false in the file config/session.php
/*
|--------------------------------------------------------------------------
| HTTP Access Only
|--------------------------------------------------------------------------
|
| Setting this value to true will prevent JavaScript from accessing the
| value of the cookie and the cookie will only be accessible through
| the HTTP protocol. You are free to modify this option if needed.
|
*/
'http_only' => true,
Also note that laravel cookies are encrypted and decrypted on the fly by the application. Even if you read the cookie, it will be the encrypted value. If you need to access and modify some non-encrypted cookies, you need to add these encryption cookies besides the list.
You can add cookies to skip encryption on the file app/Http/Middleware/EncryptCookies.php
protected $except = [
//
];
source to share
I just posted an answer to a related question that I think might also be relevant, since I believe you are dealing with client-side cookies on the server here: How to work with cookies in Laravel 5.2
source to share