How to save game information PHP/HTML/CSS/JS [closed]
Tags: javascript,php,html,css,ajax
Problem :
I am building a web browser text base RPG game with PHP/Javascript/HTML and CSS.
Each user has some information like his Name, Level, Experience, Gold and more. All the data is saved in the database.
When moving from pages in the game what will be the right method to store the data to be use in all the pages?
I thought about the following options:
- PHP SESSION
- Cookie
- Using GET with the info in the link.
What do you think is the right way to do it? In aspect of data security, hacking, easy etc.
Currently I am thinking about using PHP SESSION.
Solution :
Assuming that most of your game logic is executed on the server side, keep the game state in the PHP session. Other than cookies and GET parameters, the session information is stored on server side and for this reason out of reach for manipulations by the user.
In addition to that, save consistent states to the database often to make the game information persistent.