app/Session.php
public static function regenerate(bool $destroy = false): void
    {
        if ($destroy) {
            self::clear();
        }

        if (session_status() === PHP_SESSION_ACTIVE) {
            session_regenerate_id($destroy);
        }
    }
public static function regenerate(bool $destroy = false): void
    {
        if ($destroy) {
            self::clear();
        }

        if (session_status() === PHP_SESSION_ACTIVE) {
            session_regenerate_id($destroy);
        }
    }
public static function regenerate ( bool $ destroy = false ) : void { if ( $ destroy ) { self :: clear ( ) ; } if ( session_status ( ) === PHP_SESSION_ACTIVE ) { session_regenerate_id ( $ destroy ) ; } }
After any change in authentication level, we should use a new session ID.

@param bool $destroy

@return void
After any change in authentication level we should use a new session ID .