8 – How can I redirect user, while showing them a status message?

I’m working on a custom module, in which I want to redirect users, while showing them a status message. What I’ve tried so far only works for authenticated users but I want to redirect anonymous users. I’ve tried the below solutions so far. What else can I do?

$redirect = new SymfonyComponentHttpFoundationRedirectResponse($login->toString());
$request = Drupal::request();
$session = $request->getSession();
$session->set('msg', $config->get('girisyapmesaji'));
$redirect = new RedirectResponse($login->toString());