Styles2304 Posted September 18, 2008 Share Posted September 18, 2008 I have the user determine whether or not they want to stay logged in on the log in page and this sets a cookie. I'm trying to expire the cooking on log out but it's not happening. <?php session_start(); session_unset(); session_destroy(); setcookie ("NCF_user_index", "", 1); header("Refresh: 1; URL=../main.php"); echo "You have been logged out."; ?> I've tried the time()-234908230498 whatever number you want and that had the same effect besides I read that setting the expire time to 1 was the best way since it was one second after January 1st, 1970. Any ideas why this isn't working? Quote Link to comment https://forums.phpfreaks.com/topic/124828-solved-cookies-dont-expire/ Share on other sites More sharing options...
Styles2304 Posted September 18, 2008 Author Share Posted September 18, 2008 . . . fix = setcookie ("NCF_user_index", "", 1, '/'); Something about giving it the ability to move around the directory or whatever. Either way . . . solved. Quote Link to comment https://forums.phpfreaks.com/topic/124828-solved-cookies-dont-expire/#findComment-644886 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.