src/Chiron/Http/Session/SessionManager.php
public function setName(string $name): string
    {
        if ($this->isStarted()) {
            throw new LogicException('Cannot change the name of an active session');
        }

        if (! preg_match('/^[a-zA-Z0-9]+$/', $name)) {
            throw new InvalidArgumentException('Session name provided contains invalid characters; must be alphanumeric only and cannot be empty');
        }

        if (! preg_match('/.*[a-zA-Z]+.*/', $name)) {
            throw new InvalidArgumentException('Session name cannot be a numeric');
        }

        return session_name($name);
    }
public function setName(string $name): string
    {
        if ($this->isStarted()) {
            throw new LogicException('Cannot change the name of an active session');
        }

        if (! preg_match('/^[a-zA-Z0-9]+$/', $name)) {
            throw new InvalidArgumentException('Session name provided contains invalid characters; must be alphanumeric only and cannot be empty');
        }

        if (! preg_match('/.*[a-zA-Z]+.*/', $name)) {
            throw new InvalidArgumentException('Session name cannot be a numeric');
        }

        return session_name($name);
    }
public function setName ( string $ name ) : string { if ( $ this -> isStarted ( ) ) { throw new LogicException ( 'Cannot change the name of an active session' ) ; } if ( ! preg_match ( '/^[a-zA-Z0-9]+$/' , $ name ) ) { throw new InvalidArgumentException ( 'Session name provided contains invalid characters; must be alphanumeric only and cannot be empty' ) ; } if ( ! preg_match ( '/.*[a-zA-Z]+.*/' , $ name ) ) { throw new InvalidArgumentException ( 'Session name cannot be a numeric' ) ; } return session_name ( $ name ) ; }
Sets the current session name.

@param string $name The session name to use.

@return string

@see session_name()
Sets the current session name .