views:

1089

answers:

2

What's the easiest way to set up a cookieless domain on a WHM/Cpanel server?

And please don't answer "Don't set a cookie on your domain then", I want to ensure that even if something on the server tries to set a cookie, it won't work. If this feature is possible anyways... Thank you.

A: 

cookies have nothing to do with domains (in terms of the question u have asked). u can even set a cookie on an ip based page like http://10.0.0.1/ .. cookies are sent by the scripts on ur site and are understood by the browser. so "no" this cant be done on domain level .. this needs to be done on script/code level .. whm and cpanel have nothing to do with it either.

if u have dynamic content on ur site , the chances are u cant do much about it , contact ur developer for this .. but if u have static html pages, they generally cant send cookies.

Sabeen Malik
Then why is it when you are serving a static image from an outside domain directly, it tries to set a cookie along with the image? It's just Apache serving a static file. Who "told" Apache that there's a script somewhere on the domain that can potentially set a cookie?
joedevon
do u have code access to this other site from which the image is coming through? How can you be sure that it actually is ONLY an image and not a script sending back the image content? with apache u can use mod_rewrite to transfer control of the request to a scriptso if u request abc.jpg , apache transfer the request to myscript.php, which sends the cookie and then the image content. otherwise a plain static image has no reason to set a cookie.
Sabeen Malik
I do have total control on the dedicated server...and this is how I know..load up the Google Page Speed plugin http://code.google.com/speed/page-speed/ and you'll note their comments about serving static content on a cookieless domain. Check this out too: http://code.google.com/speed/page-speed/docs/request.html#ServeFromCookielessDomain They say something about setting up CName but I don't know much about DNS hence my question.
joedevon
ok so the thing is .. as some script on the site is setting a cookie , its the duty of the browser to send that cookie back with every request to that site again. the procedure that site is indicating towards is .. having a domain where no cookie is EVER sent by ANY script .. so if that domain never sends a cookie the browser will not send back the cookies as well. So all u basically need to do is .. create a add-on domain which points to the current domain and have that add-on domain serve ONLY images and that's it. i hope that it clears the question in ur mind.
Sabeen Malik
A: 

Maybe this helps

Cookieless

gad
Doesn't seem like anything added to what was said above, as far as I can tell.
joedevon
So you done it?
gad