Dynamic content get lost on page refresh

Dynamic content get lost on page refresh

Hi,

i have the following demo code , 
  1. <?php
  2.      if (!isset($_SESSION[$column['userid']])){
  3.            $_SESSION[$column['userid']]='offline' ;
  4.               * code for fectch data from the database for this user id
  5.       ?>
  6.           <script>
  7.           $(".Offline").append('<li class="<?php echo $column['userid'];?>"><a href="#page">foo</a></li>');
  8.           $(".Offline").listview('refresh');
  9.           </script>
  10.      <?php
  11.          
  12.              }
  13. ?>

When i refresh the page , the dynamic content get lost . How do i keep the content after refresh? .

Addition info: i have tested on mozilla firefox and internet explore 8 ,
English is not my main language give me a shout if you dont understand my question .