WebmasterSite.net: PHP scripts to enable your creativity
WSN Links PHP Directory Software
PHP Scripts Webmaster Links Support Forums


Bad Request Error

Version:
printPrint


Bad Request Error
Jenny
Forum Regular
Avatar

Usergroup: Customer
Joined: May 11, 2003
Total Topics: 38
Total Posts: 113
Posted 08/15/05 - 01:25 PM:
quote post
#1
starting this evening I am no longer able to access my gallery (http://www.nicole-media.com/images/index.php) I don't know if it works for you, but I get this error:

400 Bad Request
Your browser sent a request that this server could not understand.
Size of a request header field exceeds server limit.


Cookie: wsnuser=1; wsnpass=04710be4a203489d6c22268f20969dc9; votes=++++++[...]; linksread=%5BEND%5D7337%5B%2C%5D1123928524%5BEND%5D7443%5B%2 C%5D1123930469%5BEND%5D7463%5B%[...]; wsnuser=1; wsnpass=04710be4a203489d6c22268f20969dc9; votes=+++++[...]; linksread=%5BEND%5D7337%5B%2C%5D1123928524%5BEND%5D7443%5B%2 C%5D1123930469%5BEND%5D7463%5B%2C%[...]

the whole thing is a looooot longer
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 55
Total Posts: 5703
Posted 08/15/05 - 05:32 PM:
quote post
#2
That means there's too much cookie data, usually caused by the linksread cookie (which tracks all the images you've viewed). It looks like the problem that was in older versions of WSN but was fixed maybe 6 to 10 months ago. Yet you're using 2.14 there and I've never seen it happen in a version that recent. Maybe you have multiple installs sharing a cookie path contibuting cookies? That'd make the allowed bytes (I think it's 9000 or something) fill up faster.

Open commonfuncs.php. You should have a function like this (may differ a little since this is 2.24):

function makecookie($name, $value, $duration = '')
{
// in order to prevent apache errors, don't allow any cookie to exceed 3000 bytes. kill it if it does.
global $settings, $thismember, $cookienames, $debug;
if ($name == $cookienames['id'] || $name == $cookienames['password']) $duration = $thismember->cookieduration;
if (!$duration) $duration = time() + $settings->cookieduration;
if (!$duration) $duration = time() + 86400; // if setting is myteriously blank, make it a day
if ($duration == 'session') $duration = 0; // let expire with session if desired
if ($debug == 1) echo "<p>Setting cookie with name $name, value $value and duration $duration</p>";
// fix IE 6 default requirement of privacy policy for cookies
header("P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE" policyref="". $settings->cookiepolicy .""");
if ($settings->cookiepath != '' || $settings->cookiedomain != '')
{
if (strlen($value) > 3000) setcookie($name, " ", 1, $settings->cookiepath, $settings->cookiedomain);
else setcookie($name, "$value", $duration, $settings->cookiepath, $settings->cookiedomain);
}
else
{
if (strlen($value) > 3000) setcookie($name, " ", 1);
else setcookie($name, "$value", $duration);
}
return true;
}


Change the instances of "if (strlen($value) > 3000)" to "if (strlen($value) > 500)" and see if that helps.

Edited by Paul on 08/15/05 - 05:36 PM
Jenny
Forum Regular
Avatar

Usergroup: Customer
Joined: May 11, 2003
Total Topics: 38
Total Posts: 113
Posted 08/17/05 - 02:25 AM:
quote post
#3
I did that, but there's no change so far. I even checked to manually delete all related cookies, but there are none.

I'm using WSN Gallery at /images and WSN Links at /downloads using the same member database. Maybe that's the problem?

BTW, is that error visitor specific or is everyone seeing it?
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 55
Total Posts: 5703
Posted 08/17/05 - 06:18 PM:
quote post
#4
It's visitor specific, I'm seeing the page fine. It has to be cookies, based on that and the error. So you must not have deleted all of the cookies.

The function above would only help if you get to a page where it tries to add cookies, so I suppose when you can't reach the site at all it doesn't help.
Search thread for
Download thread as


You don't have permission to post.

Please login or register.

   
 
© 2008 Paul Knierim. All rights reserved.