fred123 Posted May 11, 2008 Share Posted May 11, 2008 Hello I'm having a bit of a problem with a member system i'm working on. I've got the login, registering and new password systems working fine, but i'm having a problem with the logout system. I login on ./index.php through ./login.php which then redirects me to ./a/index.php. All fine so far, and when i want to log out i follow the link on the ./a/index.php page to ./a/logout.php. ./a/logout.php setcookie($cookiename, "", time()-172800, "/a/"); All pretty standard and working fine in Firefox. However, in IE when i follow this link it fails to delete the cookie. The setcookie function appears to execute successfully, but simply does not delete the cookie. It doesn't work either when i type it directly into the browser address bar. It does seem to work when i type it in the Google search bar i use, which redirects me to the page, but this obviously isn't in any way practical but adds to the puzzle. Anyway, this has me rather bamboozled so any help towards solving this would be greatly appreciated. Quote Link to comment Share on other sites More sharing options...
btherl Posted May 12, 2008 Share Posted May 12, 2008 Does it work if you create and delete the cookie from scripts running under the same path? Eg, run both scripts under "/" or both scripts under "/a/". Another thing to try is to create and delete your cookie without setting the path. If either of those work, then you know it's an issue with paths. Quote Link to comment Share on other sites More sharing options...
fred123 Posted May 12, 2008 Author Share Posted May 12, 2008 The first idea doesn't work, still gives the same results. I've removed all mentions of cookie paths. It now works on IE but not on Firefox! Any more ideas? Anyone? ??? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted May 12, 2008 Share Posted May 12, 2008 Cookies are such a hassle. @_@ Use sessions, honestly. Cookies are much less secure. Quote Link to comment Share on other sites More sharing options...
btherl Posted May 12, 2008 Share Posted May 12, 2008 When faced with this kind of problem, I often use browser based tools like firefox "Live HTTP headers" and web developer toolbar, and IE's developer toolbar (download from microsoft.com). When you see exactly what headers are actually being sent by your script, sometimes you can notice something that isn't quite right. 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.