Jason28 Posted June 1, 2008 Share Posted June 1, 2008 Hello, I do not understand if it is just my PC acting weird or perhaps a bad way I coded a script. I used cookies as logins by following different tutorials and everything works perfectly. However every now and then for some reason it is like the cookies are not being stored on my PC when I try to login. The page just refreshes itself with no errors or anything and when I check my cookie folder there is nothing there. However I can login with FireFox just fine and a week or so later Internet Explorer will begin working again. Any ideas? If it is just my computer I am not too worried about it but if it is not then I do not want to have my members complain about it. Thanks! Quote Link to comment Share on other sites More sharing options...
paulman888888 Posted June 1, 2008 Share Posted June 1, 2008 I think it will be your code. How long have you set the cookie to last for. Put up some code so we can look. Or it could just be some clean up programs that are trying to cleen up space. hope that helps Quote Link to comment Share on other sites More sharing options...
Jason28 Posted June 1, 2008 Author Share Posted June 1, 2008 I have set the cookie for 7200 (I recently changed it from 3600 hoping it would solve the problem). I didn't post the code since I have other files such as the config and other includes so the cookie code may not make much sense but here it goes anyway I basically wrote it this way in case I ever wanted to change a cookie name I can and it also checks to make sure someone doesn't cheat by editing their cookie file by checking that all of the cookie values match those found in the DB. Here is part of the code for the login page: if ( clean_var($_POST["login"]) && $error != TRUE ) { $md5_pass = md5($pass . SALT); setcookie($ck_admin_user, $user, time() + $cookie_expire_time); setcookie($ck_admin_pass, $md5_pass, time() + $cookie_expire_time); setcookie($ck_admin_level, $row['level'], time() + $cookie_expire_time); header("Location: ".$site_url."admin/admin.php"); exit; } Basically just using the setcookie function. It always works in Firefox but sometimes it doesn't work in IE. Quote Link to comment Share on other sites More sharing options...
joquius Posted June 1, 2008 Share Posted June 1, 2008 Common issue: http://www.google.com/search?q=IE6+php+cookies&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a Quote Link to comment Share on other sites More sharing options...
Jason28 Posted June 1, 2008 Author Share Posted June 1, 2008 Can I get a direct solution instead of going though 279,000 unrelated webpages? Thanks. 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.