jackpf Posted March 21, 2009 Share Posted March 21, 2009 Hi all, Having a bit of a problem allowing users to log off on my site. It works fine in all browsers, except IE8 and safari. Basically, all I'm doing is expiring the cookie with the following code: setcookie('jackpf_user', '', -100000, '/', '.jackpf.co.uk'); setcookie('jackpf_admin', '', -100000, '/', '.jackpf.co.uk'); setcookie('jackpf_security', '', -10000, '/', '.jackpf.co.uk'); This works for most browsers, and the cookies are deleted, but for IE8 and Safari, the cookie still exists, but has the value "deleted", so people are logged on as "deleted"... I was just wondering if there was a better way of making sure cookies are deleted? I haven't found anything on google... Anyway, thanks for any help, Jack. Quote Link to comment Share on other sites More sharing options...
WolfRage Posted March 21, 2009 Share Posted March 21, 2009 <?php setcookie('jackpf_user', FALSE, time()-100000, '/', '.jackpf.co.uk'); ?> Quote Link to comment Share on other sites More sharing options...
jackpf Posted March 21, 2009 Author Share Posted March 21, 2009 No...that didn't work... Quote Link to comment Share on other sites More sharing options...
WolfRage Posted March 21, 2009 Share Posted March 21, 2009 Well why are you allowing users to be logged in with a value of deleted? Shouldn't the value equal what you want it too and not what ever it was last set too, else it is not a vaild login. Quote Link to comment Share on other sites More sharing options...
jackpf Posted March 21, 2009 Author Share Posted March 21, 2009 Well no, they're not actually logged in as "deleted", only their cookie says they are. I have security which checks everything against the database, so someone with this cookie would not actually be able to view anything restricted. I'm simply concerned about people not being able to log out properly. I just don't understand why it's not deleting the cookies on some browsers... Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted March 21, 2009 Share Posted March 21, 2009 http://tinyurl.com/crvmnj Quote Link to comment Share on other sites More sharing options...
jackpf Posted March 21, 2009 Author Share Posted March 21, 2009 I haven't found anything on google... Yeah, I've actually had a go at that already, dick. 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.