JS cookie variable lost after post
<p><strong>main.php:</strong></p>

<pre><code>    &lt;div id="test" class="test"&gt;
          &lt;?php  include("data.php");?&gt;
    &lt;/div&gt;
</code></pre>

<p><strong>data.php:</strong>
  In this php, i have a few query, and then print some list...Each list in an own DIV tag, and all DIV tag is "closed" when the page is load, except the last one that the user opened. I use cookie to save the the DIV ID to know which i have to open when the page is reload.</p>

<p><em>JS PART:</em></p>

<pre><code>   var test= $.cookie('test_cook');
   $('div[class*="test"]').hide();
   var op = $.cookie("test_cook");
   alert(op);
   $('div.test' + op).show();

   $('input:image').click( function() {
   var nr = $(this).attr('id').substr(7,2);
   $('div.test' + nr).toggle(400);
   $.cookie("test", nr, {expires:1 });
</code></pre>

<p>}); </p>

<p><em>PHP PART:</em>  </p>

<p>In searctest.php a print some list what the user search for, and if they want, can send to database.</p>

<pre><code>  include("searchtest.php");
</code></pre>

<p>If i reload, or close the page, then cookie is works well, the last opened DIV tag stay open. But after user make a search, and POST it, then the cookie variable will empty. </p>

<p>Could you suggest me something how can i bypass this?</p>
