phplaravelemail-verificationlaravel-authentication

Laravel 9 Email Verification logging out user


since upgrading from Laravel 6 to Laravel 9 i encounter a very interesting problem. The built in email verification thats send via email to the user, requires the user to log in when clicking on the link from the mail. When logging in you get redirected to the 'please verify your email page' basically ending in a loop.

If the user is logged in on one window and clicks the button in the verification email he gets logged out in the original window. Any suggestions how to fix this?

Kind regards


Solution

  • I finally was able to fix it. The issue wasnt related to the email verification itself. The session was lost clicking the button because the config/session.php was changed. To fix issues like this make sure that your 'same_site' is set to 'lax'

    'same_site' => 'lax',