title: restrict multiple login in different browser using a single account in laravel 5.5
body: <p>For Example i want like - 
  If user login from google chrome and trying to login from Firefox then <strong>previous session should automatically destroy with a alert message</strong>.
  So far i have done below which is actually not the correct way because it's working fine with manually logout but when user logged out automatically because of session timeout or browser close or shutdown the db not update as it should be - </p>
  
  <pre><code>protected function authenticated(Request $request, $user) 
  {
  $previous_token = $user-&gt;token_id;
  $token = $request-&gt;session()-&gt;token();
  if ($previous_token == NULL) {
   Auth::user()-&gt;token_id = $token;
      Auth::user()-&gt;save();
   }elseif ($previous_token == $token) {        }
  else
   {
    if ($previous_token != $token) {
          Auth::logout();
      }
      }
  }
  
    public function logout(Request $request, User $user)
  {
      Auth::user()-&gt;token_id = NULL;
      Auth::user()-&gt;save();
  
      $this-&gt;guard()-&gt;logout();
      $request-&gt;session()-&gt;invalidate();
      return redirect('/');
  }
  </code></pre>
  
  <p>Please assist me on this. Thanks in advance :)</p>