Apache trouble reading in large cookie contents
I'm having trouble when a browser sends a fair sized amount of data to Apache as cookies - say around 8k. I know that most clients will not allow cookies greater than 4k per cookie (and often no more than 20 per hostname), and as such have broken the cookie being sent out to be sent in smaller chunks, with names such as 'Cookie0', 'Cookie1', 'Cookie2', etc., which I would later concatenate back together to obtain the full data that I had originally sent out. However, when the browser sends data back to Apache, it sends all the cookies on the same header line (Cookie: Cookie0=...; Cookie1=...; Cookie2=...) and so on. Apache then complains (and fails the request) with a message of the sort: [date] [error] [client 1.2.3.4] request failed: error reading the headers and spits out an error screen to the user with essentially the same message, but including the "Cookie:" line I assume this is due to a compile time directive to Apache specifying the maximum size of a header line. Has anyone else run into this problem, and if so, could you point me in the right direction? Sorry if this seems to be a bit more of an Apache question than mod_perl. Thanks - Jody Biggs
Re: Apache trouble reading in large cookie contents
i'm not an expert with this, but, a quick grep for your error in the apache source (mine is still 1.3.9 ) and some digging yield: ./include/httpd.h:#define DEFAULT_LIMIT_REQUEST_FIELDSIZE 8190 so you're right, 8K is currently the apache limit. if you try to change this value in the source code, you will probably also have to muck with IOBUFSIZE and possibly other things as well. IOBUFSIZE is 8192 and the DEFAULT_LIMIT_REQUEST_FIELDSIZE is set to 2 bytes below that to make room for the extra \r\n after the last header. looks like you'll have to take responsibility for mucking with the apache source, or sending smaller cookies and using some other techniques such as HIDDEN fields. -- ___cliff [EMAIL PROTECTED]http://www.genwax.com/ "Biggs, Jody" wrote: I'm having trouble when a browser sends a fair sized amount of data to Apache as cookies - say around 8k. Apache then complains (and fails the request) with a message of the sort: [date] [error] [client 1.2.3.4] request failed: error reading the headers I assume this is due to a compile time directive to Apache specifying the maximum size of a header line.
Re: Apache trouble reading in large cookie contents
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sun, 22 Oct 2000, Gunther Birznieks wrote: Caveat: even if you modify apache to do larger cookies, it's possible that there will be a set of browsers that won't support it. Yeah, I remember very clearly from the old Netscape spec that cookies were limited to 4096 bytes. - -- "The Funk, the whole Funk, and nothing but the Funk." Vote for Ralph Nader! http://www.votenader.org Billy Donahue mailto:[EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.3 (GNU/Linux) Comment: pgpenvelope 2.9.0 - http://pgpenvelope.sourceforge.net/ iD8DBQE58OpP+2VvpwIZdF0RAkw2AJ4ibNomg6PEIxsbCF1ALy7vvGlsGQCgnv3t JARb+sDLPcMU5Nc3DrcNZT8= =twrb -END PGP SIGNATURE-
Re: Apache trouble reading in large cookie contents
There are techniques in the Eagle book for storing data in a cookie. (Check out the discussion on maintaining state) However, in my experience, you'll do better in the long run using something like Apache::Session. It'll be a scalable solution. --Jeff On Fri, 20 Oct 2000, Biggs, Jody wrote: I'm having trouble when a browser sends a fair sized amount of data to Apache as cookies - say around 8k. I know that most clients will not allow cookies greater than 4k per cookie (and often no more than 20 per hostname), and as such have broken the cookie being sent out to be sent in smaller chunks, with names such as 'Cookie0', 'Cookie1', 'Cookie2', etc., which I would later concatenate back together to obtain the full data that I had originally sent out. However, when the browser sends data back to Apache, it sends all the cookies on the same header line (Cookie: Cookie0=...; Cookie1=...; Cookie2=...) and so on. Apache then complains (and fails the request) with a message of the sort: [date] [error] [client 1.2.3.4] request failed: error reading the headers and spits out an error screen to the user with essentially the same message, but including the "Cookie:" line I assume this is due to a compile time directive to Apache specifying the maximum size of a header line. Has anyone else run into this problem, and if so, could you point me in the right direction? Sorry if this seems to be a bit more of an Apache question than mod_perl. Thanks - Jody Biggs
Re: Apache trouble reading in large cookie contents
Explictly echoing Gunther, don't go there! Use cookies, think crumbs of info, as flyweights. Significant chunks of data need to be passed and stored in other ways. Ed Gunther Birznieks wrote: Caveat: even if you modify apache to do larger cookies, it's possible that there will be a set of browsers that won't support it. At 04:48 PM 10/20/00 -0700, ___cliff rayman___ wrote: i'm not an expert with this, but, a quick grep for your error in the apache source (mine is still 1.3.9 ) and some digging yield: ./include/httpd.h:#define DEFAULT_LIMIT_REQUEST_FIELDSIZE 8190 so you're right, 8K is currently the apache limit. if you try to change this value in the source code, you will probably also have to muck with IOBUFSIZE and possibly other things as well. IOBUFSIZE is 8192 and the DEFAULT_LIMIT_REQUEST_FIELDSIZE is set to 2 bytes below that to make room for the extra \r\n after the last header. looks like you'll have to take responsibility for mucking with the apache source, or sending smaller cookies and using some other techniques such as HIDDEN fields. -- ___cliff [EMAIL PROTECTED]http://www.genwax.com/ "Biggs, Jody" wrote: I'm having trouble when a browser sends a fair sized amount of data to Apache as cookies - say around 8k. Apache then complains (and fails the request) with a message of the sort: [date] [error] [client 1.2.3.4] request failed: error reading the headers I assume this is due to a compile time directive to Apache specifying the maximum size of a header line. __ Gunther Birznieks ([EMAIL PROTECTED]) eXtropia - The Web Technology Company http://www.extropia.com/