cartalyst / sentinel

A framework agnostic authentication & authorization system.
BSD 3-Clause "New" or "Revised" License
1.51k stars 238 forks source link

check session after log in #515

Open ghost opened 4 years ago

ghost commented 4 years ago

so basically i try to implement login system with some cases case 1 : admin 1 = login member 1 = login member 2 = login

so all of them already logged in and i want to make when they're accidentally close the tab and open the dashboard url, they're still logged in but the problem appear when if one of them is log in, let's say member1, member2 also have the session of member1 because member1 and 2 have same login page

so this is how i separately the admin check login and member check login

public function checkLogin(){ if ($user = Sentinel::check()){ return redirect()->route('dashboard'); } else { $error = 'Please login'; return redirect('__/admin/login')->with('failed',$error); } } public function checkLoginMember(){ if ($user = Sentinel::check()){ return redirect()->route('index'); } else { $error = 'Please login'; return redirect('member/login')->with('failed',$error); } }

so basically the problem appear when the user have same role and same login page i already try to searching it but still messed up

thank you

brunogaspar commented 4 years ago

Not really understanding the problem here, can you please clarify the problem a bit better?

ghost commented 4 years ago

so in my app, I have multilevel login with 2 roles admin and user let's say, Jenny as user 1 Jinny as user 2

I have been trying some "QA" testing with cases :

  1. Jenny as user 1 already logged in
  2. Jinny as user 2 already logged in Both of them in the same login page The problem appears when "Jinny" log out, "Jenny" also log out It looks like they have same session