public function start(): void
    {
        // If the session is already active
        if ($this->isActive() || headers_sent()) {
            // No need to reactivate
            return;
        }

        // If the session failed to start
        if (! session_start()) {
            // Throw a new exception
            throw new SessionStartFailure('The session failed to start!');
        }

        // Set the data
        $this->data = &$_SESSION;
    }
public function start(): void
    {
        // If the session is already active
        if ($this->isActive() || headers_sent()) {
            // No need to reactivate
            return;
        }

        // If the session failed to start
        if (! session_start()) {
            // Throw a new exception
            throw new SessionStartFailure('The session failed to start!');
        }

        // Set the data
        $this->data = &$_SESSION;
    }
public function start ( ) : void { // If the session is already active if ( $ this -> isActive ( ) || headers_sent ( ) ) { // No need to reactivate return ; } // If the session failed to start if ( ! session_start ( ) ) { // Throw a new exception throw new SessionStartFailure ( 'The session failed to start!' ) ; } // Set the data $ this -> data = & $ _SESSION ; }
Start the session.

@throws \Valkyrja\Session\Exceptions\SessionStartFailure

@return void
Start the session .