ахах)))
вот я гавнокодер))
дело не в куках а в этом гавнокоде...где жопа, я понять не могу)))
<?php
if(isset($_SESSION[\'ulogin\']) && isset($_SESSION[\'upassword\'])){
$ulogin = $_SESSION[\'ulogin\'];
$upassword = $_SESSION[\'upassword\'];
$user_db = mysql_query(\"SELECT * FROM `user` WHERE `login` = \'\".$ulogin.\"\' and `password` = \'\".$upassword.\"\' LIMIT 1\"
;
$user = mysql_fetch_assoc($user_db);
mysql_query(\"UPDATE `user` SET `online`=\'\".time().\"\',`php_self`=\'\".$_SERVER[\'PHP_SELF\'].\"\' WHERE `id`=\'\".$user[\'id\'].\"\'\"
;
$user_access = mysql_fetch_assoc(mysql_query(\"SELECT * FROM `user_access` WHERE `user`=\'\".$user[\'id\'].\"\'\"
);
if(isset($user[\'id\'])){
if($user[\'login\']!=$ulogin or $user[\'password\']!=$upassword){
unset($_SESSION[\'ulogin\']);
unset($_SESSION[\'upassword\']);
}
}
}else{
$user_guest = mysql_fetch_assoc(mysql_query(\"SELECT * FROM `statistic` WHERE `ip`=\'\".$_SERVER[\'REMOTE_ADDR\'].\"\' and `ua`=\'\".$_SERVER[\'HTTP_USER_AGENT\'].\"\'\"
);
if($user_guest==0){
mysql_query(\"INSERT INTO `statistic`(
`ip`,
`ua`,
`online`
)VALUES(
\'\".$_SERVER[\'REMOTE_ADDR\'].\"\',
\'\".$_SERVER[\'HTTP_USER_AGENT\'].\"\',
\'\".time().\"\'
)\"
;
}else{
mysql_query(\"UPDATE `statistic` SET `online`=\'\".time().\"\' WHERE `ip`=\'\".$_SERVER[\'REMOTE_ADDR\'].\"\' and `ua`=\'\".$_SERVER[\'HTTP_USER_AGENT\'].\"\'\"
;
}
}
?>