I have a session lifetime of 120 minutes in my Laravel config. How can you implement that for authorized users the goods are stored longer (for example, a month), and for unauthorized users, as usual, 120 minutes? I made a cart through the Session facade If you need me to share the shopping cart code, ..
Category : cookies
I am learning laravel and in my localhost I was able to create a cookie when user submits right login credentials on the route (api/login) The cookie name is rrr_token I don’t want this to be encrypted so I added cookie name in EncryptCookies file I have shared web hosting And I uploaded app to ..
I am not able to get cookies. abc.subdomain1.xyz xyz.subdomain2.xyz here are the two subdomain My laravel project is in abc.subdomain1.xyz here is my Middleware/EncryptCookies.php file protected $except = [ ‘shared’ ]; here is my Cookie Cookie::queue(‘shared’, ‘share’, ’60’, null, ‘.domain.xyz’); return Redirect::to(‘http://abc.subdomain2.xyz/check/’.$uid); I want to share cookies from abc.subdomain1.xyz domain to xyz.subdomain2.xyz and getting cookies ..
Need your help. I have a laravel site with 5.8version, Its run in europe country. So according to eu cookies law we can not store laravel cookies without user accept. But laravel store default laravel_session & XSRF-TOKEN into user browser. How can i stop it without user accept. After user accept cookies then we store ..
I have multi step/page form that is sort of a questionnaire. There are three steps on which user fills some data and on third page he submits all that data. I did that using sessions, where certain session is called on every page and it remembers data from previous page. Problem that I have is ..
I have spa on domain A and a Laravel server on domain B I wanted to use sanctum but the cookies are only working in same domains so what u suggest is there any way around this? and I don’t want to use token base AUTH on sanctum Sourc..

I’m on Laravel 7 .env SESSION_DOMAIN= SESSION_SECURE_COOKIE=true SESSION_HTTP_ONLY=true SESSION_SAME_SITE=strict cat config/session.php <?php use IlluminateSupportStr; return [ /* |————————————————————————– | Default Session Driver |————————————————————————– | | This option controls the default session "driver" that will be used on | requests. By default, we will use the lightweight native driver but | you may specify any of ..
I’m having an issue removing a cookie in laravel. I set the cookie at login as ‘sessionToken’ and once the user logs out I flush the session, update sessionToken column to null, and forget the cookie. Yet, I can still see the cookie when I use "document.cookie" in the browser console. How can I destroy ..
I am pretty new to working with laravel (like 3 Weeks into learing) and in my Internship i am working on an app (This App does already exist and I’m just trying to improve it). This App uses radio Buttons to change the Value of a Cookie by calling an onchange command , witch in ..
We’ve a Laravel project which handles logic of the website we’re working on, and completely separated React ptoject (using create-react-app) for our website’s ui. We also installed laravel-sanctum for stateful authentication using cookies. Laravel project is served on my PC and all of local computers can access that using my local machine IP address. So ..
A user can set any one cookie on their browser. One that will be set if the submits the their email for subscription and another if they don’t want to see the pop up again. @if(Cookie::get("english")!=1 and Cookie::get("stop_popup")!=1) //my html code here @endif The user should see the subscription popup if they don’t have both ..
I use auth()->attempt() with remember me parameters. if (auth()->attempt($credentials, $rememberMe)) { When remember me is false, I can login normally, but when remember me is true, I got an error. RuntimeException Cookie jar has not been set. I tried to set .env from SESSION_DRIVER=file to SESSION_DRIVER=cookie but still didn’t work. I’m using Laravel 7.24 and ..

Here is my configuration: SERVER Laravel 8 application that uses Sanctum to provide access to REST API. It is configured to run on http://b8/ CLIENT A separate Vue CLI 3.0 SPA that connects to the API using session-based cookie authentication method. I have configured Vue CLI Serve to run it at http://app.b8/. PROBLEM Chrome does ..
If a user opens a website, he’s getting instantly redirected to a login page. Unfortunately, Laravel stores two cookies (example_domain_session and XSRF-TOKEN). Is there any way how to disable this feature and allow cookies only after being logged in? Unfortunately, I didn’t found any helpful solution yet on the internet or their documentation. I’m using ..

I used OWASP ZAP software which enable you to test your website in attacking it , it finds security failures. So I did it to my Laravel Application 5.4 version and I have this error To be honest I don’t really understand what I have to do to fix that cookie laravel_session problem, if some ..
Not sure about where to start. I run BE in the docker environment and I keep experiencing issues with cookies being lost whenever I log in via FE. I have added a logger within vendorsymphonyhttp-foundationRequest.php to log cookie data and I have learned that browser keeps sending empty cookie data after log in. So: before ..
Not sure about where to start. I run BE in the docker environment and I keep experiencing issues with cookies being lost whenever I log in via FE. I have added a logger within vendorsymphonyhttp-foundationRequest.php to log cookie data and I have learned that browser keeps sending empty cookie data after log in. So: before ..
i wrote a code in my blade page in LARAVEL that can change them dynamically by user . i save css styles in cookie and i defined css variable in my codes but in main page i get this error : Undefined index: css my code : <?php session_start(); $default = ‘dark.css’; // define stylesheets ..
I want to count the number of cookie ‘cart’ like this code, but the type is string: if(Cookie::get(‘cart’)){ $carts = Crypt::decrypt(Cookie::get(‘cart’), false); if($carts) { $carts_qty = count($carts); View::share(‘carts_qty’, $carts_qty); } } And it throws Exception: count(): Parameter must be an array or an object that implements Countable Sourc..

In my Laravel application, I am trying to look at ways of passing data back and forth between javascript and the view, this lead me to create a cookie like below: View: @push(‘scripts’) <script src="{{ asset(‘js/cookie.js’) }}" type="text/javascript"></script> @endpush //Now we are further down in the view: <div class="cookie" load="cookie(this)"> Cookie Display:<br> {{cookie(‘test’)}} //this is ..
For the purpose of a project, I need to identify automatically customers from mainsite.com on partnersite.com whithout any interaction from the customer, and whithout any parameters provided by partnersite.com as it should be almost plug-and-play for partnersite.com (so, no SSO). And, once identified, I should be able to interact with the customer, so with the ..
i set my cookie in javascript and this cookie set, my javascript code is: document.cookie = ‘products’ + ‘=’ + productsList + ";" + expires + ";path=/"; and i can see this cookie in inspect element tools, but when i want to read this cookie in laravel i get null, i can get other cookie ..

My Laravel session cookie doesn’t get set in a browser even though the server response contains the right Set-Cookie header. The Laravel server is running at localhost:8000, and the client application is a NuxtJS SPA running at localhost:7000. The response header containing Set-Cookie is as follows: HTTP/1.1 200 OK Host: localhost:8000 Date: Sun, 06 Sep ..
I’m trying to connect my angular-app to my Laravel 7 using Sanctum. The backend is running in a wamp virtualhost calls (pruebas.test) and the config is like that: .env: APP_URL=http://pruebas.test SESSION_DOMAIN=pruebas.test SANCTUM_STATEFUL_DOMAINS=localhost:4300 config/cors.php paths’ => [ ‘api/*’, ‘/login’, ‘/logout’, ‘/sanctum/csrf-cookie’ ], ‘supports_credentials’ => true, config/session.php (now is same_site equals none but I tried with lax, ..
I have a Laravel application where I am showing the listing based on the city. I am setting the city in a cookie. For the first time when the page is loaded I am setting a default city. The user can change the city. I have stored the cookie in constructor and I want to ..