joquius Posted November 2, 2006 Share Posted November 2, 2006 Ok, for some reason lately (probably due to a change I made) a session script I've been using for years has stopped working properly in IE6-7. Quite simply it is not creating cookies.The strange thing is, that it does create cookies for anonymous sessions, but not for regular user sessions (they both share the same setcookie() function)Here's some code:[code]function s_create ($user_id){ global $c_time; // current time global $_config; $s_expire = db_data ("user_level", "s_expire", "level_id", db_data ("user_list", "user_level", "user_id", $user_id)); // 3600 in this case $user_ip = $_SERVER['REMOTE_ADDR']; $s_id = md5 (uniqid ($user_ip).$c_time); setcookie ($_config['s_cookie_name'], $s_id, $s_expire + $c_time, "/"); mysql_query ("DELETE FROM `user_sessions` WHERE `s_expire` + `s_active` <= '$c_time' && `user_id` = '$user_id' && `user_id` != '-1' || `user_id` = '-1' && `user_ip` = '$user_ip'"); // deletes inactive sessions mysql_query ("INSERT INTO `user_sessions` VALUES ('$s_id', '$user_id', '$user_ip', '$c_time', '$s_expire')"); // create session in database return $s_id;}[/code]It just doesn't create a cookie for '$user_id' = 1 and obviously there aren't many options because there are no problems in firefox. Is there any chance any other function here could have any difference. Any Ideas? Quote Link to comment Share on other sites More sharing options...
joquius Posted November 8, 2006 Author Share Posted November 8, 2006 Any chance for a reply on this one? Was posted a week ago. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.