Bluz\Session\Session::setName PHP Method

setName() public method

If the session has already been started, or if the name provided fails validation, an exception will be raised.
public setName ( string $name ) : Session
$name string
return Session
    public function setName($name)
    {
        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);
        return $this;
    }