Support the ongoing development of →
Authentication Session
Last updated 2 years ago.

I figured out what was wrong and wanted to post in case it will help anyone else.

My issue was that I needed to set the credentials in order for the cross domain cookies to work. So I had to change my laravel-cors config to:

return [
    'supportsCredentials' => true,
    'allowedOrigins' => ['*'],
    'allowedHeaders' => ['*'],
    'allowedMethods' => ['GET', 'POST', 'PUT',  'DELETE'],
    'exposedHeaders' => [],
    'maxAge' => 0,
    'hosts' => [],

And then in my AJAX request, I had to add the appropriate parameter:

    type: 'POST',
    url: '',
    xhrFields: {
        withCredentials: true
    data: {
        'email': $('#email').val(),
        'password': $('#password').val()
    success: function(response){

Sign in to participate in this thread!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.