public function regenerateId() : bool
    {
        $id = $this->generateSessionId();

        if ($this->storage->updateId($this->id, $id)) {
            $this->id = $id;

            return true;
        }

        return false;
    }
public function regenerateId() : bool
    {
        $id = $this->generateSessionId();

        if ($this->storage->updateId($this->id, $id)) {
            $this->id = $id;

            return true;
        }

        return false;
    }
public function regenerateId ( ) : bool { $ id = $ this -> generateSessionId ( ) ; if ( $ this -> storage -> updateId ( $ this -> id , $ id ) ) { $ this -> id = $ id ; return true ; } return false ; }
Regenerates the session id.

This is a useful security measure that can be used after user login to even
further limit the risks of session fixation attacks.

Not all storage engines support id regeneration.
If the storage engine supports regeneration, this method returns true.
If the storage engine does not support regeneration, this method will do nothing and return false.

@return bool
Regenerates the session id .