original_string: public function setName($name): void
      {
          if ($this->sessionExists()) {
              throw new SessionException(
                  'Cannot set session name after a session has already started'
              );
          }
  
          if (!preg_match('/^[a-zA-Z0-9]+$/', $name)) {
              throw new SessionException(
                  'Name provided contains invalid characters; must be alphanumeric only'
              );
          }
  
          $this->name = $name;
          session_name($name);
      }
code: public function setName($name): void
      {
          if ($this->sessionExists()) {
              throw new SessionException(
                  'Cannot set session name after a session has already started'
              );
          }
  
          if (!preg_match('/^[a-zA-Z0-9]+$/', $name)) {
              throw new SessionException(
                  'Name provided contains invalid characters; must be alphanumeric only'
              );
          }
  
          $this->name = $name;
          session_name($name);
      }
code_tokens: public function setName ( $ name ) : void { if ( $ this -> sessionExists ( ) ) { throw new SessionException ( 'Cannot set session name after a session has already started' ) ; } if ( ! preg_match ( '/^[a-zA-Z0-9]+$/' , $ name ) ) { throw new SessionException ( 'Name provided contains invalid characters; must be alphanumeric only' ) ; } $ this -> name = $ name ; session_name ( $ name ) ; }
docstring: Attempt to set the session name
  
  If the session has already been started, or if the name provided fails
  validation, an exception will be raised.
  
  @param  string $name
  
  @throws SessionException
  @return void
docstring_tokens: Attempt to set the session name