destroy $_SESSION after cliking 'Cancel' button
<p>I would like to destroy $_SESSION['userList'] after cliking 'Cancel' button. However, the $_SESSION['userList'] is destroied when page load.</p>

<p>Below is my code:</p>

<pre><code>&lt;a href='#' class="btn" onClick="resetForm()"&gt;&lt;span&gt;Cancel&lt;/span&gt;&lt;/a&gt;

&lt;script type="text/javascript"&gt;

                function resetForm() {
                    &lt;?php

                        unset($_SESSION['userList']);

                    ?&gt;

                }
            &lt;/script&gt;
</code></pre>

<p>Really appreciate for any help.</p>
