lib/ASM/File/FileDriver.php
public function openSessionByID($sessionId, SessionManager $sessionManager, $userProfile = null)
    {
        $filename = $this->generateFilenameForDataFile($sessionId);
        $fileHandle = @fopen($filename, 'r+');

        if ($fileHandle == false) {
            return null;
        }

        $lockToken = null;
        $lockFileHandle = null;
        
        if ($sessionManager->getLockMode() == SessionConfig::LOCK_ON_OPEN) {
            $lockFileHandle = $this->acquireLock(
                $sessionId,
                $sessionManager->getSessionConfig()->getLockMilliSeconds(),
                $sessionManager->getSessionConfig()->getMaxLockWaitTimeMilliseconds()
            );
        }

        list($data, $existingProfiles) = $this->read($fileHandle);

        $existingProfiles = $sessionManager->performProfileSecurityCheck(
            $userProfile,
            $existingProfiles
        );
        
        $fileInfo = new FileInfo($lockFileHandle);

        return new FileSession(
            $sessionId,
            $data,
            $this,
            $sessionManager,
            $existingProfiles,
            $fileInfo,
            true
        );
    }
public function openSessionByID($sessionId, SessionManager $sessionManager, $userProfile = null)
    {
        $filename = $this->generateFilenameForDataFile($sessionId);
        $fileHandle = @fopen($filename, 'r+');

        if ($fileHandle == false) {
            return null;
        }

        $lockToken = null;
        $lockFileHandle = null;
        
        if ($sessionManager->getLockMode() == SessionConfig::LOCK_ON_OPEN) {
            $lockFileHandle = $this->acquireLock(
                $sessionId,
                $sessionManager->getSessionConfig()->getLockMilliSeconds(),
                $sessionManager->getSessionConfig()->getMaxLockWaitTimeMilliseconds()
            );
        }

        list($data, $existingProfiles) = $this->read($fileHandle);

        $existingProfiles = $sessionManager->performProfileSecurityCheck(
            $userProfile,
            $existingProfiles
        );
        
        $fileInfo = new FileInfo($lockFileHandle);

        return new FileSession(
            $sessionId,
            $data,
            $this,
            $sessionManager,
            $existingProfiles,
            $fileInfo,
            true
        );
    }
Open an existing session. Returns either the session data or null if
the session could not be found.
@param Session $session
@param SessionManager $sessionManager
@param null $userProfile
@return null|string