Kill the cookie "PHPSESSID"

<?php session_start(); session_set_cookie_params(0, '/', ' .'.myDomain.''); ?>The code above produces cookie named “PHPSESSID” and its value, for example, "1526af544bBeebf932e358e047965961’.

I like to delete the cookie “PHPSESSID”.

Following code is some of my trials for deleting the cookie. but doesn’t work as I expected.

session_set_cookie_params(time()-3600, '/', ' .'.myDomain.'');

setcookie('PHPSESSID', '', time()-3600, '/', ' .myDomain');

How can I delete the cookie “PHPSESSID”?

Ending you session will do that.

I tried the code following for ending my session.

unset($_SESSION['PHPSESSID']);But the code above seems not to end my session.
How can I end the session?

session_destroy();

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.