不能同时销毁cookie和会话?

I'm trying to destroy visitors cookie and session at same time when he/she logs out. Like this:

setcookie($id, '', time()-13600, "/");
unset($_SESSION[$id]);

Although cookie destroys but user is still logged in because session not destroying.

Note: I can't use session_unset() because it will destroy all the sessions.

PS: I solved my problem just by not setting session but only cookie, still i can't solve problem i asked above.

well you could use session_destroy() in order to unset the session for current user. the rest of sessions will stay unchanged. this is how you do it

<?php
session_destroy();

for destroy all sessions use this code

<?php
session_destroy();

for unset any session you can do it by session : key

<?php
unset($_SESSION['key_name']);