Previous Thread
Next Thread
Print Thread
Rating: 5
Page 1 of 3 1 2 3
#232474 01/10/2003 1:03 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Updated for UBB.threads 6.2

This will display your cookies and allow you to expire them. When a user is having problems that seem cookie related have them use this to clear their cookies.

Place it in your ubbthreads directory and provide a link to the mycookies.php script.

DEMO: Here at threadsdev


Update (January 13, 2003): With Carl's more informative instructions/information I decided to add in language file support. The zip includes the english language file "mycookies.lang.php" which needs to be placed in all language directories. Translate as needed.

Updated on January 19, 2003 to include German language file. Thanks Carl/Astaran

Updated on January 26, 2003 to hopefully work on all installs.

Updated on January 26 (hours later), 2003 to hopefully work on all installs again.


If you do translate the language file please post your translation so I can add it to the zip file for others. Thanks.
Attachments
64372-mycookies.6.2.1.zip (0 Bytes, 179 downloads)

Last edited by JoshPet; 02/16/2003 6:13 AM.
Sponsored Links
Joined: Sep 2001
Posts: 129
Member
Member
Offline
Joined: Sep 2001
Posts: 129


Regards
Clint

Running on WIN2003 Web Server.

Paranoid people get followed too!
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Guess I should rename this. It's not a "pal" for IIP. It's stand alone. Place it in your ubbthreads directory.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Ok renamed it. Should be less confusion now.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I had thought about adding this into the IIP package once or twice before. I'll probably do so sometime tonight.

Sponsored Links
Joined: Sep 2001
Posts: 129
Member
Member
Offline
Joined: Sep 2001
Posts: 129
cheers Dave working now

Should have looked at the script


Regards
Clint

Running on WIN2003 Web Server.

Paranoid people get followed too!
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
That's good.

I broke it though when I renamed the file. I forgot to set the location it returns to when expiring cookies to the new name. All fixed now.

Joined: Oct 2002
Posts: 165
Member
Member
Offline
Joined: Oct 2002
Posts: 165
How does this differ from the earlier version that seems to still work?

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Incoming variable values are pulled using the get_input function in .threads 6.2 so register globals can be turned off for better security. Other possible cookie paths are used in addition to the configured path to cover cookies that may have been inadvertantly set with the wrong paths during setup or maintenance of the forums. Depending on your setup your old script will NOT delete your w3t_visit cookie in .threads 6.2. Cookie values are decoded to show their exact value for curiosity's sake as well.

I had to look to see myself and while I was at it I found another error. I had the form posting to the old cookiepal.php script and not the new name. I also put the new table wrappers of .threads 6.2 to use and made the display validate XHTML 1.0 transitional as well. I'll upload it again after this post.

This is how it differs.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
This script is one of the best threads add ons. It should be standard. Thanks Dave.

Sponsored Links
Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
Once again you rule!

Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
Thank you for this cool tool.

I thought that giving some more explanation to the users would help, so I extended your feedback-messages a little:

echo "<tr><td class="darktable" colspan="2"><form method="post" action="{$config['phpurl']}/mycookies.php"><input type="submit" name="submit" value="Expire Cookies" class="buttons" /><input type="hidden" name="doExpire" value="1" /><input type="hidden" name="Cat" value="$Cat" /></form>
[:"brown"]<p>Expiring (deleting) your board's cookies might be useful if you suspect that they are damaged and the board is malfunctioning.</p><p>Expiring those cookies will do NO harm at all, but this will log you out of the board. - Once you login and start using the board again, new fresh cookies will be set automatically.</p>[/]
</td></tr>$tbclose";

echo "<tr><td align="left" class="lighttable" colspan="2">You have no current cookies.[:"brown"] - This will log you out. Once you login and start using the board again, new cookies will be set automatically. [/]</td></tr>";

Last edited by caymuc; 01/13/2003 6:23 PM.
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Thanks

I'll get your extra information into this yet tonight.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I just added in your extra information in the form of a language file. I'm hoping that you will supply a German version of the language file so I can package it up with the zip.

If anyone else can provide other languages please post the translated language files here and I'll update the zip with them. Thanks!

Joined: Jun 2001
Posts: 176
Member
Member
Offline
Joined: Jun 2001
Posts: 176
Wow more good stuff dave . Thanks man .

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Your welcome

Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
[]I'm hoping that you will supply a German version [/]

OK, I'll try:

[:"#666666"]<p>Expiring (deleting) your board's cookies might be useful if you suspect that they are damaged and the board is malfunctioning.</p>
<p>Expiring those cookies will do NO harm at all, but this will log you out of the board. - Once you login and start using the board again, new fresh cookies will be set automatically.</p> [/]

</p><p>Das Löschen der Forum-Cookies kann z.B. sinnvoll sein, wenn das Forum nicht wie erwartet funktioniert und Sie vermuten, dass es vielleicht an beschädigten Cookies liegen könnte.</p>
<p>Das Löschen dieser Cookies richtet KEINEN Schaden an aber Sie werden aus dem Forum abgemeldet. Sobald Sie sich erneut anmelden, werden automatisch neue, "frische" Cookies im Browser angelegt.</p>

[:"#666666"]You have no current cookies. - This will log you out. Once you login and start using the board again, new cookies will be set automatically. [/]

Sie haben keine Forum-Cookies (mehr) in Ihrem Browser. - Sie werden nun aus dem Forum abgemeldet. Sobald Sie sich erneut anmelden, werden automatisch neue Cookies im Browser angelegt.

Last edited by caymuc; 01/15/2003 4:05 PM.
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Thanks Carl but would you mind downloading the zip and creating a german language file based on the english one that's included and attaching it here? Thanks.

Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
I created the german language file based on Carls suggestions.
See attached file.
Attachments
65164-mycookies.lang.txt (0 Bytes, 57 downloads)

Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
Just noticed that $user has no value in this script. Since this page doesn't care about user authentification i'd suggest to replace send_header param $user with '0'.

Joined: Aug 2002
Posts: 45
User
User
Offline
Joined: Aug 2002
Posts: 45
Amazing hack
This has to be standard

Thanks Dave

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Thanks Astaran. I somehow missed your post here. I'll get this in the main zip right now.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I added a call to auth in so that the $user array is filled if being viewed by a registered user. Otherwise a call to auth is made in the send_header function when there is no $user information.

Thanks for pointing that out Astaran.

Last edited by JustDave; 01/19/2003 9:30 AM.
Joined: Sep 2001
Posts: 15
Newbie
Newbie
Offline
Joined: Sep 2001
Posts: 15
Hi,
I went an added this much needed utility, however it is not functioning for me. I attempted this on 3 separate forums I run, all on different boxes. I had a couple of other users visit the url and it did not delete our cookies or log us out. Not sure if it has some restrictions?
I would love to get this thing functioning
Best Wishes,
Charlie

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
This script needs to be placed in your ubbthreads directory to work. I'm not sure why it wouldn't work otherwise. What is the URL to your forum with this script in it?

Joined: Mar 2002
Posts: 305
Enthusiast
Enthusiast
Offline
Joined: Mar 2002
Posts: 305
It's working great for us Dave.

As Dave said, make sure the "mycookies.php" file is in your regular .threads directory, and the "mycookies.lang.php" file is in your "languages/english/" folder.

I actually added a little blurb about it on the logout page, and put the link there. It wouldn't matter where the link is though, as long as you had the URL to the page correct.


[:"red"]Lisa[/]
Joined: Sep 2001
Posts: 15
Newbie
Newbie
Offline
Joined: Sep 2001
Posts: 15
It is in the correct directory and stuff, just puzzled why it will not function.
http://www.aaca.org/ubbthreads/mycookies.php
It is on a Windows server, not sure if this is related.
Thanks for your reply!
Charlie

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Off hand I can't see why it wouldn't work. It's a really simple script. Are the server times messed up? Perhaps the expiration time needs to be set further back?

Joined: Sep 2001
Posts: 15
Newbie
Newbie
Offline
Joined: Sep 2001
Posts: 15
has me really puzzled as well as I have it working on a few of our other forums, but on completely different boxes. The big difference is that they are all running Linux and this box is a Windows server. Times are all ok as well and I will try adjusting the expiration time and let you know how that goes.
Best Wishes,
Charlie

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I just updated the script and the language files. Install them and let me know how it goes.

Joined: Sep 2001
Posts: 15
Newbie
Newbie
Offline
Joined: Sep 2001
Posts: 15
Thanks for the update, unfortunately it still will not work with this site
I played around with the expiration time, manually deleted all my cookies a number of times and still not a go.
Do you know if anyone else using this on a Windows Server?
Not sure if that is the root of this problem or not.
Best Wishes,
Charlie

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Can you manually log out from the forum on your windows machine? I have one idea left... lol

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Ok scratch that. I'm fresh out of ideas at the moment with this...

Do you have a test login I can use to view this on your windows machine with?

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Ok I adjusted the script again. This time not only are we expiring the cookie but also setting it's value to an empty string. Maybe this is needed on a windows box? That's how .threads logs a user out so if that works this should work? LoL I hope.

Joined: Sep 2001
Posts: 15
Newbie
Newbie
Offline
Joined: Sep 2001
Posts: 15
Thanks again!
I just updated the script, manually dumped all my cookies to start off fresh, logged in and then tried the script and still a no go .
Do you still need that test account? Looks like you registered already, but need to confirm it.
Best Wishes,
Charlie

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Yeah I registered but I used my garbage can email address so I have no way of confirming. I quit using my regular email address for checking sites as I get email from the admins that I don't care for but now this can be opted out of. I really have no idea why it's not working though. Maybe something is causing the cookie names to be wrong during their expiration.

Joined: Sep 2001
Posts: 15
Newbie
Newbie
Offline
Joined: Sep 2001
Posts: 15
Not a problem, I just approved it so as long as you chose your initial password, you should be able to login and give the mycookies.php a whirl to see what is happening if you still want to take a look at it further.

I really do appreciate your time with this among all your other projects! Looking forward to your Pro release of IIP

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I played around with a few ideas and have yet another modified version I'll be uploading tomorrow morning. What ever is going on it's got to be something simple... (and overlooked) LoL

Joined: Sep 2001
Posts: 15
Newbie
Newbie
Offline
Joined: Sep 2001
Posts: 15
Thanks again, but unfortunately it still does not work on this forum. Works great on our other forums, but this one is really stubborn.
Best Wishes,
Charlie

Joined: Aug 2002
Posts: 111
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 111
I wanted to post and mention how much I love this hack. I've always had lots of cookie problems whenever I have to "login as user", but now I can easily dump the cookies and it fixes the problem immediately. Much easier than manually deleting my cookies, closing the browser, etc. Very handy!

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Users at one of my forums... report that the site is faster for them after they use the cookie utility.

Joined: Sep 2001
Posts: 15
Newbie
Newbie
Offline
Joined: Sep 2001
Posts: 15
could this problem I am experiencing be related to the custom cookie prefix?
Best Wishes,
Charlie

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
It shouldn't. I have used this with several different cookie prefixes at the same time and it cleared them all. When the cookie names/values are displayed are the names correct? Those are the exact names that get expired. If I could get ftp access to your site I could test a couple ideas I have but honestly I can't see why it's not working at this point...

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Get Linux... LoL no j/k (well not really but don't want to get into any debates) LoL

Anyhow... If your running your site from a windows machine would you mind installing this cookie script and letting me know if it works? Thanks for any input/help you can give.

Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
Didn't I see where somebody put a link into the login screen? Can't seem to find that thread on the hack to place the link. Love this tool.. but want to make it easier for them to find.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I added a link into the generic error message. My "how to" and advice is here.

That helped alot.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
This is a MUST HAVE.

If you want to see a demo... it's installed here at threadsdev.

Joined: Aug 2002
Posts: 218
Member
Member
Offline
Joined: Aug 2002
Posts: 218
I think I found a failure in this hack.

Line:
$ubbt_language = ${$config['cookieprefix']."w3t_language"};
seems to be wrong cause w3t_language is only the tables name if you did not change the preffix.

I am using cf as prefix therefore my table is called: cf_languages.

Check out http://www.clanforums.com/mycookies.php for the (I think wrong) output. Can you please check if I am right and then please correct it?

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
No, it's not an error. That's the way it's supposed to be. Also, your link 404's.

Joined: Aug 2002
Posts: 218
Member
Member
Offline
Joined: Aug 2002
Posts: 218
[]JustDave said:
No, it's not an error. That's the way it's supposed to be. Also, your link 404's. [/]

Sorry the link is:
http://www.clanforums.com/ubbthreads/mycookies.php

Can you take a look again?

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
The script is correct. No need to look but I did. I don't have any cookies so there were none displayed.

Joined: Aug 2002
Posts: 218
Member
Member
Offline
Joined: Aug 2002
Posts: 218
The output is for me (for example!)

Cookie Name:
cfw3t_language

Cookie Value:
English

I am wondering why is cfw3t_language cause it should be cf_language. I thought the line I posted here before is the problem. What do you think?

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
This is correct:

cfw3t_language


This is not correct:

cf_language



The line of code you posted is correct. There is no error.

I think there is no problem here.

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
I too get no error's when visiting site. I of course have no cookies.

So I signed up and tried it out. It expires my cookie fine and of course I am logged out.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yeah the cookies always have the prefix of w3t_ the cookie prefix is differen than the database table prefix.

Joined: Aug 2002
Posts: 218
Member
Member
Offline
Joined: Aug 2002
Posts: 218
Then everything is right and working for me

Only wondered about this w3t_

Joined: Oct 2000
Posts: 15
Newbie
Newbie
Offline
Joined: Oct 2000
Posts: 15
Is it possible to get this great utillity to work on a 6.1 UBBThreads forum?

When i tested i got
Code
 <br />Fatal error: Call to undefined function: get_input() in /<path to my installation>/ubbthreads/mycookies.php on line 37<br /><br /> 



"Do not meddle in the affairs of sysadmins, for they can make your life miserable by doing nothing." <img src="/threads/php/images/graemlins/wink.gif" alt="" /> Unknown
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I think this will work for you.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I may be wrong but in 6.1 the globals were artificially registered by .threads so you may be able to just comment out the get_input line and have it work.

Joined: Oct 2000
Posts: 15
Newbie
Newbie
Offline
Joined: Oct 2000
Posts: 15
Comment out the whole line?
Code
// $doExpire = get_input("doExpire","post"); 

Or just remove get_input ?

Update..tested, does not seem to work but JoshPet found one that works for me
So it might come to use when we upgrade our forum

Last edited by Erik_Rana; 02/17/2003 8:18 PM.

"Do not meddle in the affairs of sysadmins, for they can make your life miserable by doing nothing." <img src="/threads/php/images/graemlins/wink.gif" alt="" /> Unknown
Joined: Oct 2000
Posts: 15
Newbie
Newbie
Offline
Joined: Oct 2000
Posts: 15
Yes
Thanks!


"Do not meddle in the affairs of sysadmins, for they can make your life miserable by doing nothing." <img src="/threads/php/images/graemlins/wink.gif" alt="" /> Unknown
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I'm glad Josh found the older version. I wasn't sure if it was around here or not. It's good to hear it's working for you.

Joined: Jun 2002
Posts: 160
Member
Member
Offline
Joined: Jun 2002
Posts: 160
I have an embarrassingly newbish question to ask here . . . I've installed this mod, and everything seems to function as it should. However, I'm a bit lost (I have NO doubt whatsoever that if/when this is answered, and I see it, I'll go "Oh, duh, of course, it's so obvious" and feel like a heel) as to where a good place to make this file accessible to users/linked would be, and what code in which (template?) file(s) to use for there to be a ready link to it outside of an actual post.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I placed a link to it in the footer here. (ubbt_footer.tmpl)

You could also place it in the FAQ section or as a link in a sticky post of a "help" forum. It could also be added to the navigation bar (ubbt_registerednav.tmpl, ubbt_unregisterednav.tmpl).

Joined: Jun 2002
Posts: 160
Member
Member
Offline
Joined: Jun 2002
Posts: 160
[] I placed a link to it in the footer here. (ubbt_footer.tmpl) [/]
Ahh, that works. Very convenient and almost sneaky, I didn't even notice it down there until my attention was directed to it.

Thanks for the suggestion.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
he he.....
it probable didn't appear until you asked.

But I like it!

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
LoL actually it's been there since Sunday.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
LOL
Maybe I don't spend enough time here to notice.

Good place to put it.

Joined: May 2002
Posts: 362
Junior Member
Junior Member
Offline
Joined: May 2002
Posts: 362
If anyone wants it, I created this []http://www.ourfreerein.com/ubbthreads/cookiess.gif[/]

I placed this right above the footer and below the Main Configuration part in the MY HOME section. This is where I noticed my users usually get stuck when their cookies go bad.

I can attach the code with the graphics if wanted.


-peter


(Just noticed my typo in there too!lol!)

Joined: Aug 2002
Posts: 218
Member
Member
Offline
Joined: Aug 2002
Posts: 218
Yepp this is looking nice. Post the info how you did it here, I am sure that someone might find it useful

sjsaunders #232544 02/28/2003 10:15 AM
Joined: Jan 2003
Posts: 338
Enthusiast
Enthusiast
Offline
Joined: Jan 2003
Posts: 338
Warning: Unable to access /home/virtual/ubbdev.com/var/www/html/threads/php/languages/english/mycookies.lang.php in /home/virtual/site2/fst/var/www/html/threads/php/mycookies.php on line 30

Dawg_dup1 #232545 02/28/2003 11:23 AM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Make sure the language file is readable and that it exists.

Joined: May 2002
Posts: 362
Junior Member
Junior Member
Offline
Joined: May 2002
Posts: 362
In myhome.tmpl find

Code
 <br /> <br />UBBTPRINT; <br /> <br />/* UBBTREMARK */ ?> <br /> 



Above that ADD:
Code
 <br><br> <br />$tbopen <br /><td class="lighttable"> <br /><img align="middle" src="{$config['images']}/utilities.gif" alt="!" /> <br />Are you stuck?  Is something not working?  Use this utility! A quick fix for most problems! <br />(You'll have to re-login though.) <br /></td><td class="lighttable" align="center"> <br /> <img align="middle" src="{$config['images']}/utilities.gif" alt="{$ubbt_lang['EDIT_TEXT']}" /> <br /> <a href="{$config['phpurl']}/cookiepal.php"> <br />Fix! <br /></a> <br /></td> <br /></tr> <br />$tbclose 


You should place the utilities.gif file in the images folder, and place the cookie utility file
in your main folder of threads, with ubbthreads.php.

The image I used is attached.

Attachments
71314-utilities.gif (0 Bytes, 111 downloads)

Joined: Feb 2003
Posts: 64
Power User
Power User
Offline
Joined: Feb 2003
Posts: 64
I installed the My Cookies script and it seems to work fine except this error shows up over the cookie description:

Warning: urldecode() expects parameter 1 to be string, array given in /home/www/thebuzznyc/members/ubbthreads/mycookies.php on line 53

Any ideas?

Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
I added the cookies link similar to what is on this site. used the board rules mod as my instructions. I had to change the language file too.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
In the mycookies.php file there is a line at the bottom of the file that looks like this (or close to it):

header("Location: {$config['phpurl']}/mycookies.php?Cat=$Cat");


Change that line to this:


header("Refresh: 0; URL=/mycookies.php?Cat=$Cat");




This should work on a windows box too now.

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
would that require the mycookies.php file to be in the root directory?


- Allen wavey
- What Drives You?
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
The machine I tested it on wouldn't work if I used

header("Refresh: 0; URL={$config['phpurl']}/mycookies.php?Cat=$Cat");

but that may be because things are sort of "not right" on that machine. (not my doing, btw) lol

I have added this type of redirect to the shoutbox scripts using the {$config['phpurl']} and did not have any problems so I would recommend adding it in. I'm actually not sure if it would work otherwise on a machine that "is right"... lol

Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
header("Location: {$config['phpurl']}/mycookies.php?Cat=$Cat");

should work on all machines if their is no output before that statement.
"Location" is part of the http protocol and should work with all standard browsers. Make sure you use a absolute URI as the target. Relative URI will work on most browsers but the RFC specifies that it has to be an absolute one.

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
hmm.. maybe removing the / would work, since the file should be in the same directory? Idda know, just lookin, I need to install it and try it out


- Allen wavey
- What Drives You?
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
On one windows box, for sure, cookies were not set when using the header("Location: "); redirect. One fix was to generate a transition page with a <meta> refresh tag. Using the header("Refresh: 0; URL= "); solution is easier and cleaner.

It was a windows machine causing the problem... go figure.

Anyhow... the others that have reported this utility as not working were having problems on windows boxes. (I do believe they all were but I could be wrong)




Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Is "Refresh" a valid HTTP header? If not, shouldn't echo() or print() be used instead of header()?

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
As far as I can tell, no it's not specified. I found some limited discussions on it's use but only as options against header/Location. I'm still going over the specifications though. Perhaps there is an additional header that can be sent with Location to get the same affect?

I'm also looking at the fact that no output is supposed to be sent before a header() call. This could be the reason the cookies are not being expired?

I guess I'll keep going over this but for now the header/Refresh does seem to work.

Page 1 of 3 1 2 3

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240430)