Hi,
I'm making a game and I got different objects (planets, spaceships, ...) with different interfaces and data. To display the correct interface with the correct data (e.g. resources owned by this object) I need to have the object's id.
Currently, I solve this problem by putting the id into the URL, like this:
planet/5/overview // typeOfInterface/objectId/page
Of course, I check if the id belongs to the currently logged in user.
But I think that's not the best, cleanest solution. I'd rather prefer using sessions (or is there an even better way, what do you think?). But there's one big problem that comes with it.
I would save the current objectId inside the session. But I need to change the object id when clicking on a link (e.g. to go from planet A to planet B).
I could create a connecting route (e.g. /objectId/change/{$objectId}) that changes the id and redirects somewhere else. But this connecting route doesn't know where to redirect. I don't know how to tell it that. Anyways, this would be a bad solution as well I think. It makes everything more complicated and indirect.
Do you ave any ideas how to be able to change data in a session when clicking a link?