How to set cookie based on browser tab
<p>In my application i have set a cookie like </p>

<pre><code>if(!isset($_COOKIE["uk_redirect_flag"])) {
    setcookie("uk_redirect_flag", 1, time() + (86400 * 30), "/"); 
}
</code></pre>

<p>so if uk_redirect_flag = 0 I'm showing some flash message. If uk_redirect_flag =1 the flash message wont display. It is working in one tab on firefox. So my problem is when i open another tab on firefox uk_redirect_flag value is still 1.
I need to delete the cookie when i open new tab or close tab. How to set cookie value based on browser tab?</p>