public function createSession(SessionManager $sessionManager, $userProfile = null)
    {
        list($sessionId, $fileHandle) = $this->createNewSessionFile();

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

        $existingProfiles = [];
        if ($userProfile !== null) {
            $existingProfiles[] = $userProfile;
        }

        $fileInfo = new FileInfo($lockFileHandle);
        $this->save($sessionId, [], $existingProfiles,  $fileInfo);
        // fclose($fileHandle); umm.

        return new FileSession(
            $sessionId, 
            [],
            $this,
            $sessionManager,
            $existingProfiles,
            $fileInfo,
            false
        );
    }
public function createSession(SessionManager $sessionManager, $userProfile = null)
    {
        list($sessionId, $fileHandle) = $this->createNewSessionFile();

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

        $existingProfiles = [];
        if ($userProfile !== null) {
            $existingProfiles[] = $userProfile;
        }

        $fileInfo = new FileInfo($lockFileHandle);
        $this->save($sessionId, [], $existingProfiles,  $fileInfo);
        // fclose($fileHandle); umm.

        return new FileSession(
            $sessionId, 
            [],
            $this,
            $sessionManager,
            $existingProfiles,
            $fileInfo,
            false
        );
    }
public function createSession ( SessionManager $ sessionManager , $ userProfile = null ) { list ( $ sessionId , $ fileHandle ) = $ this -> createNewSessionFile ( ) ; $ lockFileHandle = null ; if ( $ sessionManager -> getLockMode ( ) == SessionConfig :: LOCK_ON_OPEN ) { $ lockFileHandle = $ this -> acquireLock ( $ sessionId , $ sessionManager -> getSessionConfig ( ) -> getLockMilliSeconds ( ) , $ sessionManager -> getSessionConfig ( ) -> getMaxLockWaitTimeMilliseconds ( ) ) ; } $ existingProfiles = [ ] ; if ( $ userProfile !== null ) { $ existingProfiles [ ] = $ userProfile ; } $ fileInfo = new FileInfo ( $ lockFileHandle ) ; $ this -> save ( $ sessionId , [ ] , $ existingProfiles , $ fileInfo ) ; // fclose($fileHandle); umm. return new FileSession ( $ sessionId , [ ] , $ this , $ sessionManager , $ existingProfiles , $ fileInfo , false ) ; }
Create a new session.
@param SessionManager $sessionManager
@param null $userProfile
@throws AsmException
@return string The newly created session ID.
Create a new session .