Hello
I need to store some very long text inside a cookie using php's setcookie
the problem is that sometimes the text is too long for the browser to handle
and I get the following error:
400 Bad Request
Your browser sent a request that this server could not understand.
Size of a request header field exceeds server limit.
Is there a way to compress the value I am about to save in the cookie
and then to uncompress it again when I read the value from the cookie?
I just need to make sure that the encoding of the compressed value will be
legal for the browser to store in the cookie so that the uncompression will work
Is this possibe?
I would appreciate leads to PHP compression solutions if possible
regards
how to compress a cookie value
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
if this will be used on multiple servers, you'll still have a problem with size limitations of cookies. There are several alternates, such as storing it in session variables or a database.
gzcompress() may be of interest, it has links to other compressions php supports.
gzcompress() may be of interest, it has links to other compressions php supports.