Blocking a Cookie

Hi Patrick,

I would like to run some tests with one particular cookie blocked. I tried the setCookie in the script, but I noticed the a new cookie was created and set to the value I specified, what I really awnted was to overwrite the original cookie. As a result, I ended up with two cookies (One looking like cookie=0, the other looking like cookie=). Is there a way to do this in the script?

Thanks.

You might be able to use the setHeader command to override the cookie header for requests to the specific host. That’s the only possibility that comes to mind.

Hey Patrick, can you give me a quick example?

I tried doing
setHeader Cookie: cookie=0;

But I notice the cookie I’m setting is still going to its default value.

The [font=Courier]Cookie [/font]header is sent in the request headers to indicate to the server that the client already has a cookie saved. The header to set the cookie value is [font=Courier]Set-Cookie[/font], which is sent in the response headers from the server.

So unless you can get WPT to alter the response headers, I would think that blocking the cookie would require changes on your end.

More info: http://msdn.microsoft.com/en-us/library/windows/desktop/aa384321(v=vs.85).aspx

Any chance you can link to an example (or PM one to me)? It’s possible that there’s a bug on my side or it’s browser specific. Chrome and Firefox may be more likely to do it correctly since they modify the headers on the outbound writes directly on the wire.