How to delete session by the array index?

Your image doesn’t actually show you having indexes 0 and 1, but anyway. Have you checked in your delete function what exactly the value of $index is?