public function takeAll($namespace = 'default')
    {
        if ($this->state !== static::STATE_ACTIVE && $this->state !== static::STATE_EXPIRED) {
            if ($this->debug) {
                throw new \RuntimeException('Session is not active.');
            }

            return false;
        }

        $bag = $this->getBag($namespace);
        $all = $bag->all();

        $this->clean($namespace);

        return $all;
    }
public function takeAll($namespace = 'default')
    {
        if ($this->state !== static::STATE_ACTIVE && $this->state !== static::STATE_EXPIRED) {
            if ($this->debug) {
                throw new \RuntimeException('Session is not active.');
            }

            return false;
        }

        $bag = $this->getBag($namespace);
        $all = $bag->all();

        $this->clean($namespace);

        return $all;
    }
public function takeAll ( $ namespace = 'default' ) { if ( $ this -> state !== static :: STATE_ACTIVE && $ this -> state !== static :: STATE_EXPIRED ) { if ( $ this -> debug ) { throw new \ RuntimeException ( 'Session is not active.' ) ; } return false ; } $ bag = $ this -> getBag ( $ namespace ) ; $ all = $ bag -> all ( ) ; $ this -> clean ( $ namespace ) ; return $ all ; }
Get all session data and clean them.

@param   string $namespace Session namespace, default is `default`.

@return  array
@throws \RuntimeException

@since   2.0.4
Get all session data and clean them .