How can session_name() affect the deletion of sessions in PHP?

When using session_name() to set a custom session name in PHP, it is important to use the same custom session name when trying to delete the session. If the session name is not set correctly when trying to delete the session, PHP may not be able to locate and delete the session data.

<?php
// Set custom session name
session_name("my_custom_session");
session_start();

// To delete the session, use the same custom session name
session_name("my_custom_session");
session_unset();
session_destroy();
?>