On high traffic sites, this can substantially increase the size of subsequent HTTP requests from clients (including requests for static content on the same domain).

More importantly though, the cookie specification says that browsers need only accept 20 cookies per domain.

Did top and bom dating Chat hotroom

It has been suggested that this setting can effectively help to reduce identity theft through XSS attacks (although it is not supported by all browsers), but that claim is often disputed. Note that the value portion of the cookie will automatically be urlencoded when you send the cookie, and when it is received, it is automatically decoded and assigned to a variable by the same name as the cookie name.

If you don't want this, you can use You may also set array cookies by using array notation in the cookie name.

If you're having problem with IE not accepting session cookies this could help: It seems the IE (6, 7, 8 and 9) do not accept the part 'Expire=0' when setting a session cookie. The default behavior when the 'Expire' is not set is to set the cookie as a session one.

(Firefox doesn't complains, btw.) Note when setting "array cookies" that a separate cookie is set for each element of the array.

something that wasn't made clear to me here and totally confused me for a while was that domain names must contain at least two dots (.), hence 'localhost' is invalid and the browser will refuse to set the cookie!

instead for localhost you should use make your code work on both localhost and a proper domain, you can do this: Of notice, the cookie when set with a zero expire or ommited WILL not expire when the browser closes.) will make the cookie available to that subdomain and all other sub-domains of it (i.e. To make the cookie available to the whole domain (including all subdomains of it), simply set the value to the domain name ( the cookie will be made accessible only through the HTTP protocol.This means that the cookie won't be accessible by scripting languages, such as Java Script.I do not serialize any class instances, just arrays and simple objects.In a nutshell, when setting a cookie value, I serialize it, gzcompress it, base64 encode it, break it into pieces and store it as a set of cookies.This has the effect of setting as many cookies as you have array elements, but when the cookie is received by your script, the values are all placed in an array with the cookie's name: Note: You can use output buffering to send output prior to the call of this function, with the overhead of all of your output to the browser being buffered in the server until you send it.