404labfr / 404labfr/laravel-impersonate
Impersonate doesn't work because don't open a user session
- Dominant language
- PHP
- Stars
- 2.3k
- Forks
- 235
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
i'm using impersonate 1.2 on my laravel 5.6 installation.
I'm going to admin area and on every user i've put a button "login as user" and i call impersonate function on my HomeController :
```
public function impersonate($user_id){
if ($user_id!= ''){
$user = User::find($user_id);
Auth::user()->impersonate($user);
return redirect()->route('myPlan.history');
}
return redirect()->back();
}
```
but when i click on that i cannot open route myPlan.history impersonated as other user. But if i login with another simple user and then go back to admin area and click again on "login as user" every works fine, so i think that function doesn't create a user session.
How can i fix?
Thanks
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.