src/SessionTrait.php
public function clear(): SessionInterface
    {
        # Get all the current session data
        $values = $this->getAll();

        # Replace all the values with nulls
        $values = array_map(function ($value) {
            return null;
        }, $values);

        # Store all the null values (effectively unsetting the keys)
        $this->set($values);

        return $this;
    }
public function clear(): SessionInterface
    {
        # Get all the current session data
        $values = $this->getAll();

        # Replace all the values with nulls
        $values = array_map(function ($value) {
            return null;
        }, $values);

        # Store all the null values (effectively unsetting the keys)
        $this->set($values);

        return $this;
    }
public function clear ( ) : SessionInterface { # Get all the current session data $ values = $ this -> getAll ( ) ; # Replace all the values with nulls $ values = array_map ( function ( $ value ) { return null ; } , $ values ) ; # Store all the null values (effectively unsetting the keys) $ this -> set ( $ values ) ; return $ this ; }
Clear all previously set values.

@return SessionInterface
Clear all previously set values .