Laravel Impersonate works locally, but not on production server

89 views Asked by At

I'm using lab404's laravel-impersonate package in a Laravel 8 project.

On my localhost, I've had no issues at all. I can impersonate users as expected.

Now that I'm on production and really need it though, I click my impersonate link which uses the routes for take/{id} And it does a 302 redirect from take/{id} to the correct page projects. But then it does another 302 redirect back to the login page.

Nothing was written to my logs.

I'm using FortRabbit's manages PHP hosting. Their Professional Stack.

Any ideas why it's doing this. Or why might it be doing this on my production server?

1

There are 1 answers

0
Oliver Stark On

To me this issue feels session related.

A) try a driver that works well with multi node environments (database, cookie, memcached .. see https://laravel.com/docs/10.x/session#configuration)

B) Double check if the domain and protocol is consistent across all redirects (what our for https vs http, w/wo www, ...)

C) Contact fortrabbit support if you are not able to solve it on your own.