mercredi 20 avril 2022

Laravel app with prefixed dot cookie reload login page

I have Laravel app that sometimes refuses login without any error message, just the login view is reloaded.

However, I found a cookie prefixed with . to the domain (HTTPS), when I delete that cookie from the browser's storage, it works fine and login goes well.

enter image description here

I don't know what is the problem and why removing such prefixed cookie with dot solves the issue?

This is .htaccess

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On
   Redirect 302 /stop /stop.php
    

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f    
    RewriteRule ^ index.php [L]
    

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

Also due to using multiple domains for the same app, config/session.php I set the domain dynamically to be:

 'domain' => env('SESSION_DOMAIN', $_SERVER['HTTP_HOST']?? null),

Is there any hint to help this conditional issue?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire