protected function unpersist($pathname)
    {

        // the requested session file is not a valid file
        if ($this->sessionFileExists($pathname) === false) {
            return;
        }

        // initialize the variable for the marshalled session data
        $marshalled = null;

        // decode the session from the filesystem
        $fh = fopen($pathname, 'r');

        // try to lock the session file
        if (flock($fh, LOCK_EX) === false) {
            throw new SessionDataNotReadableException(sprintf('Can\'t get lock to load session data from file "%s"', $pathname));
        }

        // read the marshalled session data from the file
        while (feof($fh) === false) {
            $marshalled .= fread($fh, 1024);
        }

        // try to unlock the session file
        if (flock($fh, LOCK_UN) === false) {
            throw new SessionDataNotReadableException(sprintf('Can\'t unlock session file "%s" after reading data', $pathname));
        }

        // query whether or not the session has been unmarshalled successfully
        if ($marshalled === null) {
            throw new SessionDataNotReadableException(sprintf('Can\'t load any session data from file %s', $pathname));
        }

        // unmarshall and return the session data
        return $this->unmarshall($marshalled);
    }
protected function unpersist($pathname)
    {

        // the requested session file is not a valid file
        if ($this->sessionFileExists($pathname) === false) {
            return;
        }

        // initialize the variable for the marshalled session data
        $marshalled = null;

        // decode the session from the filesystem
        $fh = fopen($pathname, 'r');

        // try to lock the session file
        if (flock($fh, LOCK_EX) === false) {
            throw new SessionDataNotReadableException(sprintf('Can\'t get lock to load session data from file "%s"', $pathname));
        }

        // read the marshalled session data from the file
        while (feof($fh) === false) {
            $marshalled .= fread($fh, 1024);
        }

        // try to unlock the session file
        if (flock($fh, LOCK_UN) === false) {
            throw new SessionDataNotReadableException(sprintf('Can\'t unlock session file "%s" after reading data', $pathname));
        }

        // query whether or not the session has been unmarshalled successfully
        if ($marshalled === null) {
            throw new SessionDataNotReadableException(sprintf('Can\'t load any session data from file %s', $pathname));
        }

        // unmarshall and return the session data
        return $this->unmarshall($marshalled);
    }
protected function unpersist ( $ pathname ) { // the requested session file is not a valid file if ( $ this -> sessionFileExists ( $ pathname ) === false ) { return ; } // initialize the variable for the marshalled session data $ marshalled = null ; // decode the session from the filesystem $ fh = fopen ( $ pathname , 'r' ) ; // try to lock the session file if ( flock ( $ fh , LOCK_EX ) === false ) { throw new SessionDataNotReadableException ( sprintf ( 'Can\'t get lock to load session data from file "%s"' , $ pathname ) ) ; } // read the marshalled session data from the file while ( feof ( $ fh ) === false ) { $ marshalled .= fread ( $ fh , 1024 ) ; } // try to unlock the session file if ( flock ( $ fh , LOCK_UN ) === false ) { throw new SessionDataNotReadableException ( sprintf ( 'Can\'t unlock session file "%s" after reading data' , $ pathname ) ) ; } // query whether or not the session has been unmarshalled successfully if ( $ marshalled === null ) { throw new SessionDataNotReadableException ( sprintf ( 'Can\'t load any session data from file %s' , $ pathname ) ) ; } // unmarshall and return the session data return $ this -> unmarshall ( $ marshalled ) ; }
Tries to load the session data from the passed filename.

@param string $pathname The path of the file to load the session data from

@return \AppserverIo\Psr\Servlet\Http\HttpSessionInterface The unmarshalled session
@throws \AppserverIo\Appserver\ServletEngine\SessionDataNotReadableException Is thrown if the file containing the session data is not readable or no lock for the session file can be obtained
Tries to load the session data from the passed filename .