Entity/EntityService.php
private function removeValues($prefix, SessionInterface $session)
    {
        foreach ($session->all() as $key => $value) {
            if (0 === strpos($key, $prefix)) {
                $session->remove($key);
            }
        }
    }
private function removeValues($prefix, SessionInterface $session)
    {
        foreach ($session->all() as $key => $value) {
            if (0 === strpos($key, $prefix)) {
                $session->remove($key);
            }
        }
    }
private function removeValues ( $ prefix , SessionInterface $ session ) { foreach ( $ session -> all ( ) as $ key => $ value ) { if ( 0 === strpos ( $ key , $ prefix ) ) { $ session -> remove ( $ key ) ; } } }
Removes from the session all the key-value pairs whose key has the specified prefix.

@param string $prefix
@param \Symfony\Component\HttpFoundation\Session\SessionInterface $session
Removes from the session all the key - value pairs whose key has the specified prefix .