Handling state of website with JavaScript
I'm currently working on a chat that heavily relies on JavaScript and which uses node.js for the backend. I'd like to do as much as possible in JavaScript (maybe even no PHP at all if possible). One of the problems I ran into is how to hold the state of the site. When a user clicks on a contact the content of the communication is fetched from the server. What would you suggest to save the id of the currently displayed contact. Anchor? Variable? Cookie?

Thank you!
Handling state of website with JavaScript
===

I'm currently working on a chat that heavily relies on JavaScript and which uses node.js for the backend. I'd like to do as much as possible in JavaScript (maybe even no PHP at all if possible). One of the problems I ran into is how to hold the state of the site. When a user clicks on a contact the content of the communication is fetched from the server. What would you suggest to save the id of the currently displayed contact. Anchor? Variable? Cookie?

Thank you!