Iam using a RedirectResponse in drupal 8 in my custom module when a user is logging in,
$user = User::load(\Drupal::currentUser()->id());
$userRoles = $user->getRoles();
if(in_array('admin',$userRoles)){
$response = new RedirectResponse('/home');
$response->send();
}
later i was trying to change the url but even after removing the code the redirection occurs.