How to make the history of message output?

The essence is that there is a variable that gives text. With each press “Button” it changes. You need to write all these messages and output in the form of history. The story itself will be needed only for the current session, so after using it needs to be reset.

Tell me how it is better to implement?

Answer 1

javascript + any server language (well, according to tradition, this is usually PHP). Ajax just initialize the session and read it to withdraw history. As you know, after closing the browser, the session is destroyed. Thus, you will not need to take care of cleaning …