You can get the page refreshed automatically.and you can save all the message in server side, whenthe page asked for refresh, send them back.