3raser Posted March 31, 2011 Share Posted March 31, 2011 Hey there, I currently have a banning system on my site that doesn't allow users to login with the banned account. But the cookies are set to remember them for a year. How can I destroy their cookie, so that they don't stay logged in and continue to use the site? Quote Link to comment https://forums.phpfreaks.com/topic/232236-forcing-a-cookie-to-close/ Share on other sites More sharing options...
sunfighter Posted March 31, 2011 Share Posted March 31, 2011 setcookie('Cookie_Name','',time()-3600); set the value to zero and the time to the past. Quote Link to comment https://forums.phpfreaks.com/topic/232236-forcing-a-cookie-to-close/#findComment-1195243 Share on other sites More sharing options...
btherl Posted April 1, 2011 Share Posted April 1, 2011 Or you can change the code which checks for the "logged in" cookie so it also checks if the user is banned. I hope your cookies are secure enough that someone can't login just by setting the cookie themselves. Quote Link to comment https://forums.phpfreaks.com/topic/232236-forcing-a-cookie-to-close/#findComment-1195389 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.