Well i suppose my setcookie syntaxis correct, (it works in another script) but i can't get the following script to work.
-When visiting my site, the users can register themselves then a session ID is
assigned to each of them (by cookie). (datas stored in a table with MySQL)
The pbr is : deleting an user (and his session id) from the table doesn't delete the cookie on the user's station. So i tried to put the following code at the top of each of my pages (before the HTML tag) to destroy the Session_id cookie that doesn't match with the table :
<?php
if (isset($sessid)) {
mysql_connect("myserver", "myname", "mypasswd");
mysql_select_db("mybase");
$query = mysql_query("SELECT * FROM usertable WHERE (session_id='$sessid')");
if (mysql_num_rows($query) > 0)
{echo "nothing to delete";}
else {$sessid="";
setcookie("sessid", null, time() + 31536000, "/");}
}
?>
I tested the code, but no cookies is sent when i'm viewing the page with a sessid that isn't in the table, i can't figure out why...