I’m designing a simple board game in jquery/php. The state of the board is currently stored server-side in a php session variable as an array. Each turn is executed as an ajax call to php, which executes logic to update this array, and returns the array to jquery to render as html. I’m achieving persistence of board state with php session variables…but I don’t think this is good practise. I can’t even play it in multiple tabs, because the browser treats both tabs as part of the same session. I would like to find a solution other than store board state in a database…but if this is the only reasonable solution please let me know :). Thanks!
Share
How about a javascript library like Lawnchair to store the data on the client side?
It Dom storage spans across tabs as well.
via Dive.Into.Javascript