views:

51

answers:

3

I am serving dynamic image content which is generated by PHP. But for such requests to a .php file, the PHPSESSID cookie is being sent along, which is a waste.

Is it possible to prevent PHP from sending this cookie with requests to a PHP file? Or is it completely necessary for PHP to work?

Thanks for your time!

+1  A: 

This is used by PHP's session functions. If your site doesn't use sessions, then this probably shouldn't be showing up.

Keep in mind that the cookie is sent by the browser and you have no control over its transmission.

George Edison
+4  A: 

The browser will send any cookie that applies to a certain path-domain combination. You have no control over that, except using different paths and domains. This is why many sites use static content domains.

Matthew Flaschen
Aahh.. I use static content domain for some stuff. Somehow failed to use my mind in this case. Anyway, thanks Mathew!
Nirmal
A: 

you're saying "dont use cookies for sessions, use a phpsessid as a get parameter" php deprecated this for a reason. Cookies will always be sent to the same domain. If you really want to avoid the MINIMAL overhead, resources which dont need cookies should be in a separate domain, thus the cookie wont be sent. IE. static.domain.com for static content. It's not worth the hassle, honestly.

mhughes