Jump to content

[SOLVED] Logout problem


xnowandtheworldx

Recommended Posts

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

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;

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 :P lol, but alright, i'll try the -360 one :)

 

EDIT: And what-do-yah-know the $time = time() - 360 worked! Thanks! I appreciate it!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.