run event once only
<p>i have code to check for browser and at the moment it is running each time i refresh page. is it possible to run only once on each visit so if i refresh or are taken to that page by link then the code is ignored. thanks</p>

<pre><code>    &lt;script type="text/javascript"&gt;
            if($.browser.msie &amp;&amp; $.browser.version=="8.0" || $.browser.msie &amp;&amp; $.browser.version=="7.0") 
            alert("Please upgrade your browser to at least version 8.0 in order to use all the features of this site.\n\nThank you.");
    &lt;/script&gt;
</code></pre>

<p>updated code supplied by darin:</p>

<pre><code>&lt;script type="text/javascript"&gt;
    var date = new Date(); date.setTime(date.getTime() + (30 * 60 * 1000)); $.cookie("explorer", "foo",{ expires: date });
        var cookie = $.cookie('explorer');

    if (cookie == null) {
        // the cookie is not present =&gt; you may do the checks
        if ($.browser.msie &amp;&amp; $.browser.version == '8.0') {
            // set the cookie so that the next time the user visits this page
            // he doesn't get the alert message
            $.cookie('explorer', 'true');
            alert("Please upgrade your browser to at least version 8.0 in order to use all the features of this site.\n\nThank you.");
        }
    }
 &lt;/script&gt;
</code></pre>

<p>the alert is not firing though</p>
