src/Session.php
public function regenerateId()
    {
        if (!$this->idRegenerated) {
            $this->getStore()->delete($this->getId());
            $this->getIdHandler()->generateId();

            $this->regenerationTrace = time();
            $this->idRegenerated = true;

            return true;
        }

        return false;
    }
public function regenerateId()
    {
        if (!$this->idRegenerated) {
            $this->getStore()->delete($this->getId());
            $this->getIdHandler()->generateId();

            $this->regenerationTrace = time();
            $this->idRegenerated = true;

            return true;
        }

        return false;
    }
public function regenerateId ( ) { if ( ! $ this -> idRegenerated ) { $ this -> getStore ( ) -> delete ( $ this -> getId ( ) ) ; $ this -> getIdHandler ( ) -> generateId ( ) ; $ this -> regenerationTrace = time ( ) ; $ this -> idRegenerated = true ; return true ; } return false ; }
Regenerates session id.

Destroys current session in store and generates new id, which will be saved
at the end of script execution (together with values).

Id is regenerated at the most once per script execution (even if called a few times).

Mitigates Session Fixation - use it whenever the user's privilege level changes.
Regenerates session id .