**UPDATE ON THE PROBLEM:**

* On some browsers, we have two PHPSESSIDs.
* One PHPSESSID is not set by me anywhere in my script
* It has HOST (instead of DOMAIN for the PHPSESSID I set) as www.mywebsite.com
* I have tried deleting it using setcookie: `setcookie ("PHPSESSID", $_COOKIE['PHPSESSID'], time() - 864000, '/', 'www.mywebsite.com');` but this fails.
* An attempt to delete cookie using: `setcookie ("PHPSESSID", $_COOKIE['PHPSESSID'], time() - 864000, '/');` results in the PHPSESSID I set being deleted.
* I have tried using `session_name` to rename the SESSION I set. This works but crashed my server severally after some minutes.
* I am out of options.

---

I am working with PHP sessions on my website. 

The session path was /folder, later on I changed to / to fit the new purpose.

Now, old users cant login.

It seems they now have two PHPSESSIDs stored on their browsers - one with path /folder and the other /.

What can I do to ensure that old users can login while ensuring that the session is sitewide with "/".

**MORE INFORMATION**

When I said two phpsessionid, refer to the image

[![the two PHPSESSID](https://i.stack.imgur.com/J42HE.png)](https://i.stack.imgur.com/J42HE.png)

2. The login works if I use

A. `session_set_cookie_params(864000, '/cv', '.website.com', 0, 1);`

but fails to work if I use:

B. `session_set_cookie_params(864000, '/', '.website.com', 0, 1);`

* If I use Version 2A above, the session will only be available in /cv and not be available in other website folders eg. /folder.

**UPDATE ON DELETING PHPSESSID WITH JAVASCRIPT**

* When I run alert(document.cookie), it shows all cookies except the PHPSESSID
* Hence all attempts to delete the PHPSESSID cookie fails, whereas other cookies can be deleted.

**UPDATE ON DELETING PHPSESSID WITH PHP**

* When I `var_dump($_COOKIE['PHPSESSID']);` what is returned is the value of the PHPSESSID with path /cv
* An attempt to delete with `setcookie ("PHPSESSID", "", time() - 3600);` fails.