Read Cookies In Laravel Blade Created In JS
I am beginner webdeveloper. I make my project in Laravel 7 and jQuery. I create cookies in JavaScript (jQuery) and I need read it in Laravel Blade. I have this code: !function(e,t)
Solution 1:
Also, you should keep in mind that by default Laravel can only read cookies set by Laravel.
The Laravel automatically encrypts all cookies with Bcrypt. You can do one of the following:
- Use Laravel backend to create your cookies. (Recommended)
- Encrypt your cookie value with Bcrypt in order to Laravel read them.
- Disable Laravel cookie encryption, which should allow your Laravel application to read cookies from all sources. (Not recommended)
Sources:
1. Using Laravel to create cookies
2. Reading Laravel Bcrypt within Javascript
Post a Comment for "Read Cookies In Laravel Blade Created In JS"