After reading an article about casting pointers as TObject not being a good idea, I have created a class with an integer property. `TSessionData.Index` where index is an integer.
I have to create and destroy the object on my own, but this appears to be the better way.