title: How do I delete PHPSESSID on client computers
body: <p><strong>UPDATE ON THE PROBLEM:</strong></p>
  
  <ul>
  <li>On some browsers, we have two PHPSESSIDs.</li>
  <li>One PHPSESSID is not set by me anywhere in my script</li>
  <li>It has HOST (instead of DOMAIN for the PHPSESSID I set) as www.mywebsite.com</li>
  <li>I have tried deleting it using setcookie: <code>setcookie ("PHPSESSID", $_COOKIE['PHPSESSID'], time() - 864000, '/', 'www.mywebsite.com');</code> but this fails.</li>
  <li>An attempt to delete cookie using: <code>setcookie ("PHPSESSID", $_COOKIE['PHPSESSID'], time() - 864000, '/');</code> results in the PHPSESSID I set being deleted.</li>
  <li>I have tried using <code>session_name</code> to rename the SESSION I set. This works but crashed my server  severally after some minutes.</li>
  <li>I am out of options.</li>
  </ul>
  
  <hr>
  
  <p>I am working with PHP sessions on my website. </p>
  
  <p>The session path was /folder, later on I changed to / to fit the new purpose.</p>
  
  <p>Now, old users cant login.</p>
  
  <p>It seems they now have two PHPSESSIDs stored on their browsers - one with path /folder and the other /.</p>
  
  <p>What can I do to ensure that old users can login while ensuring that the session is sitewide with "/".</p>
  
  <p><strong>MORE INFORMATION</strong></p>
  
  <p>When I said two phpsessionid, refer to the image</p>
  
  <p><a href="https://i.stack.imgur.com/J42HE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/J42HE.png" alt="the two PHPSESSID"></a></p>
  
  <ol start="2">
  <li>The login works if I use </li>
  </ol>
  
  <p>A. <code>session_set_cookie_params(864000, '/cv', '.website.com', 0, 1);</code></p>
  
  <p>but fails to work if I use:</p>
  
  <p>B. <code>session_set_cookie_params(864000, '/', '.website.com', 0, 1);</code></p>
  
  <ul>
  <li>If I use Version 2A above, the session will only be available in /cv and not be available in other website folders eg. /folder.</li>
  </ul>
  
  <p><strong>UPDATE ON DELETING PHPSESSID WITH JAVASCRIPT</strong></p>
  
  <ul>
  <li>When I run alert(document.cookie), it shows all cookies except the PHPSESSID</li>
  <li>Hence all attempts to delete the PHPSESSID cookie fails, whereas other cookies can be deleted.</li>
  </ul>
  
  <p><strong>UPDATE ON DELETING PHPSESSID WITH PHP</strong></p>
  
  <ul>
  <li>When I <code>var_dump($_COOKIE['PHPSESSID']);</code> what is returned is the value of the PHPSESSID with path /cv</li>
  <li>An attempt to delete with <code>setcookie ("PHPSESSID", "", time() - 3600);</code> fails.</li>
  </ul>