UBB.Dev
Posted By: Lisa_P no more cookie problems? - 06/28/2002 10:34 PM
I realize this isn't really a mod or a mod suggestion, but I couldn't figure out a better place for it.

I just know as soon as I post this the software will make a liar out of me , but . . . .

I made a few very tiny changes with the cookies about a week ago, and I haven't had a single problem since. I'm always completely logged out now when I click logout.

I changed the following:

In logout.php, I made the fixes I noted in this bug report.

I also looked through the ubbt.inc.php file, and noted any cookies it set. I added the w3t_language cookie to logout.php. I only know English, so I never changed my language and not having that cookie stay on my computer isn't an issue. I don't know if it would be bothersome to those who regularly read in another language.

I also changed all the figures from [:"red"]- 3600[/] to [:"red"]- 86400[/]. The original sets the cookie backwards 1 hour. I read someplace (in my many travels on the web trying to learn about cookies) that some people believe the - 3600 standard that many websites use isn't long enough, given differences in time zones. That article suggested 24 hours instead. So I switched all of the cookies to - 86400.

So I changed this:
code:
setcookie("w3t_myid","", time() - 3600,"{$config['cookiepath']}");
setcookie("w3t_mysess","", time() - 3600,"{$config['cookiepath']}");
setcookie("w3t_visit","", time() - 3600);
setcookie("w3t_key","", time- 3600,"{$config['cookiepath']}");
}

// ----------------------------------
// Give them a new login box
$html -> send_header($ubbt_lang['LOGIN_PROMPT'],$Cat,0,$user,0,0,1);
if ($config['tracking'] == "cookies") {
$rememberme = "<input type="checkbox" name="rememberme" value="1" cla
ss="formboxes" /> {$ubbt_lang['REMEMBER_ME']}<br /><br />";
}



to this:
code:
setcookie("w3t_myid","", time() - 86400,"{$config['cookiepath']}");
setcookie("w3t_mysess","", time() - 86400,"{$config['cookiepath']}");
setcookie("w3t_visit","", time() - 86400, "{$config['cookiepath']}");
setcookie("w3t_key","", time() - 86400,"{$config['cookiepath']}");
setcookie("w3t_language","",time() - 86400,"{$config['cookiepath']}");
}

// ----------------------------------
// Give them a new login box
$html -> send_header($ubbt_lang['LOGIN_PROMPT'],$Cat,0,$user,0,0,1);
if ($config['tracking'] == "cookies") {
$rememberme = "<input type="checkbox" name="rememberme" value="1" class="formboxes" /> {$ubbt_lang['REMEMBER_ME']}<br /><br />";
}



As I said, I haven't had a problem yet. But I've had 3 boards up in different directories and haven't had a problem, when normally I would have by now. I guess when we open the board up to all the members I'll know if it really makes a difference, because I won't get 10 emails a day from people who can't log in.

I know a few people have mentioned that it may be necessary to erase the cookies from both www.yourdomain.com and yourdomain.com, but when I was looking through our logs yesterday, I noticed a fair amount of hits to our Dedicated IP address as well. I had never thought of the IP address as an additional cookie that could have been set. Those wouldn't have shown up if I told people just to delete the cookies from our domain, since most people wouldn't recognize our IP address.

One of these changes may have been what helped, or it may have been all of them, or it may have been none of them. It's working for now, so I don't dare look into it any further. If someone sees something wrong post.
Posted By: MTO Re: no more cookie problems? - 06/29/2002 12:48 AM
Moving this to the V6 Modifications board as it seems a post requesting feedback on a modification and possibly assistence for bug-testing it.
Posted By: Lisa_P Re: no more cookie problems? - 06/29/2002 12:56 AM
Thanks!
Posted By: WrÅith Re: no more cookie problems? - 06/30/2002 6:48 AM
Thanks Lisa!

I've applied it to my board. I'll let you know if I have any problems.
© UBB.Developers