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?

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