This is IMO wrong. I would do this like:
```php
if ($request->hasSession() && $request->isMethod('GET') && 'referer' === $this->config->getRedirectRoute('show')) {
    $session  = $request->getSession();
    $referers = $session->get('sylius_resourse_referers', array());
    $uriHash  = md5($request->getUri());

    if (!isset($referers[$uriHash])) {
       $referers[$uriHash] = $request->headers->get('referer');
       $session->set('sylius_resourse_referers', $referers);
    }
}