Ending a session/clearing cookies
<p>Ok, so I've got some legacy code from another company that I have to maintain/repair. One of the features of this code is that there are several sites tied to this one main site, and whenever you navigate from the other sites to this site, a logo from the other site is displayed on the main site (basically this is a service for multiple banks to use, and each bank wants its own branding).</p>

<p>The problem is is that once you navigate from, say, site1 to main site, if you then navigate from site2 to main site, you'll still get site1's branding.</p>

<p>Is there a way to clear a session's cookies? So far they've got code like this, which should THEORETICALLY work:</p>

<pre><code>    else
    {
        setcookie("cuid","",time() - 31536000); //DELETES COOKIE

        if( $cuid_demo!="samplecu" &amp;&amp; $cuid!="samplecu" )
            setcookie("cuid",$cuid,time()+2592000); //2592000 = 1 month

        $link=dbconnect();

        if(!$link)
            die("error: Could not connect to database - ".dberror() );

        select_db($link) or die("error: ".dberror() );

        if (isset($admin_id))
        {
            $cuid = $admin_id;
            $id = $admin_id;
        }

        $query="UPDATE cusucceed SET visits=visits+1 WHERE id = '$cuid'";
        $result=dbquery($link, $query)or die("Database Server Error 2: ".dberror());
        include("index_main.php");

    } //END IF/ELSE TO CHECK FOR PREVIOUS VISIT WITH THE PAST MONTH
}
</code></pre>

<p>Before it does nothing. Shouldn't <code>setcookie("cuid", "", time() - 31536000);</code> delete the cookie, as the comments say?</p>
