xnowandtheworldx Posted August 10, 2008 Share Posted August 10, 2008 Alright, well my site was recently hacked (due to a real stupid error on my part! includes and crons had full access! :X) and ever since then my logout button hasn't been working, I don't know what the problem is, but was wondering if any of you could help out? heres my code $time = -time() + 86400; setcookie('username', $_COOKIE['username'], $hour); header("Location: index.php"); do you see any problems with that? :\ Link to comment https://forums.phpfreaks.com/topic/119006-solved-logout-problem/ Share on other sites More sharing options...
genericnumber1 Posted August 10, 2008 Share Posted August 10, 2008 try changing $hour to $time on the second line Plus, that first line is all over the map, it works in its current state (it wouldn't many many many years ago, but that's beside the point ) but it will be easier to read if it's something like $time = time() - 360; Link to comment https://forums.phpfreaks.com/topic/119006-solved-logout-problem/#findComment-612806 Share on other sites More sharing options...
xnowandtheworldx Posted August 10, 2008 Author Share Posted August 10, 2008 woops I actually just changed the variable name $hour to $time so I wouldn't look like an idiot since that isn't an hour long time lol, but alright, i'll try the -360 one EDIT: And what-do-yah-know the $time = time() - 360 worked! Thanks! I appreciate it! Link to comment https://forums.phpfreaks.com/topic/119006-solved-logout-problem/#findComment-612810 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.