Symfony – keep session (database storage) after multi redirect

When my users log in, a session is created.

While browsing, they are forced to be redirected several times to https://login.microsoftonline.com

When the session is stored in a flat file, no problem, the session is found, the user is logged in.

When I store the session in the database, the user is recognized and the session follows its navigation well.
By cons, when I redirect it to https://login.microsoftonline.com, the Symfony session no longer appears in the browser console and the user is no longer recognized.

My code to save the session in the database:

service.yml

    SymfonyComponentHttpFoundationSessionStorageHandlerPdoSessionHandler:
        arguments:
            - '%env(DATABASE_URL)%'

framework.yml

    session:
        #handler_id: null
        #name: ACSESSID
        handler_id: SymfonyComponentHttpFoundationSessionStorageHandlerPdoSessionHandler
        gc_maxlifetime: 3600
        cookie_secure: auto
        cookie_samesite: lax

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *