|
02-20-2004, 12:38 PM | #1 |
Green Mole
Join Date: Nov 2003
Posts: 11
|
bug with cookies?
hey all,
I think I have found a bug in PHPDig were it is not passing cookies for all requests. When PHPDig does a HEAD request to a file, it passes all the cookies properly, but when it actually goes to read the file it uses the PHP file(...) function instead of doing a proper GET request. (admin/robot_functions.php, phpdigTempFile(...) function, line 682) Why does this matter? Well, I have a multilingual site that uses the PHP session to find the current language setting to render the appropriate text. By not sending cookies, I cannot restore my session to find the proper language setting and thus always get the default text. I have coded a fix for myself to solve my problem by creating a phpdigfile(...) function that executes a proper GET request instead of using the file() function. Has anyone else run into this problem? |
02-20-2004, 06:25 PM | #2 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Hi. I haven't personally come across this issue.
>> I have coded a fix for myself to solve my problem... Mind sharing?
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
02-21-2004, 11:10 AM | #3 |
Green Mole
Join Date: Nov 2003
Posts: 11
|
Sure no problems, here is the function I wrote. I cut / pasted most of the code from your other functions. I'm sure some of this stuff can be broken out into utility functions to avoid the redundancy.
I don't think this is the perfect solution. I have not had time to debug further yet, but the spidering is awfully slow. Somewhere around 20 seconds per page - yikes! I also noticed that on my platform, (Linux + Apache) the phpDigSetHeaders(...) function doesn't seem to be working properly. The function ini_set's user_agent but if I error_log(ini_get('user_agent')) on the line after it comes up blank... strange... maybe this is why I'm experiencing this whole cookie problem in the first place... Anyhoot, here is the function. I put it in the robot_functions.php file, and I replaced line 682 of that same file to use it: line 682: PHP Code:
PHP Code:
|
02-21-2004, 05:30 PM | #4 |
Green Mole
Join Date: Feb 2004
Location: North Las Vegas, Nevada
Posts: 18
|
Hi there,
I think you forgot to escape a few "'s ."User-Agent: PhpDig/".PHPDIG_VERSION." (+<a href=\"http://www.phpdig.net/robot.php\" target=\"_blank\">http://www.phpdig.net/robot.php</a>)".END_OF_LINE_MARKER.END_OF_LINE_MARKER; I think this would work better. Otherwise I am getting a parse error. Mr. L |
02-21-2004, 08:47 PM | #5 |
Green Mole
Join Date: Nov 2003
Posts: 11
|
heh good catch -- it appears that this forum software took the liberty of inserting some code on me. There actually shouldn't be any href around the url at all.
To make things easier, I can send anyone interested a patch against v1.8, let me know. TTYL! |
05-04-2004, 11:20 AM | #6 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Hi fredh, what's the current status of this mod? Have a file to attach?
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
05-04-2004, 07:47 PM | #7 |
Green Mole
Join Date: Nov 2003
Posts: 11
|
you bet! I have attached a patch for the robot_functions.php file and I have attached the snoopy GPL library that I used to implement the fix.
Download the file here: phpdig1.8-fredh-patch.zip Simply copy the Snoopy.class.php file into the /includes dir and apply the patch. Let me know if I can be of any more help, thanks! Last edited by fredh; 05-04-2004 at 07:49 PM. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Do i need help or is it a bug? | se7en | Troubleshooting | 2 | 03-16-2006 07:23 AM |
IE bug? | FaberFedor | Troubleshooting | 6 | 01-30-2005 04:39 PM |
Logout does not clear cookies | manfred | Bug Tracker | 6 | 07-12-2004 03:58 PM |
Not really a bug | cybercox | Mod Requests | 0 | 04-04-2004 07:03 AM |
cookies and phpdig | Darknss | Troubleshooting | 2 | 03-05-2004 08:38 PM |