views:

158

answers:

2

I have VB6 web application and I have to remove cookie. Unfortunately cookie has underscore character in name -- exemplary cookie name looks like that: XXXXXXAAASS_session_key.

When I try to remove it by assign empty value to it:

Response.cookies.Item("XXXXXXAAASS_session_key") = ""

I've got a new cookie with name `XXXXXXAAASS%5Fsession%5Fkey (underscore in encoded as %5F) as my Firefox browser reported (both in Cookie view somewhere in FF options and in Firebug view of request).

I also tried to clear this cookie from Javascript with code like:

document.cookie = 'XXXXXXAAASS_session_key_session_key=;expires=Thu, 01-Jan-70 00:00:01 GMT;path=/';

This also didn't work :( -- creates cookies in other domain.

I am afraid I cannot change cookie name.

Now I will try to iterate over cookies collection, but I don't believe it will work :(.

Any idea what I can do wrong?

A: 

That's probably because you have a ` character before your cookie name in your code.

AngryHacker
Unfortunately this was just a typo while editing my question.
Grzegorz Gierlik
A: 

Problem was solved, partly...

I could not clear the cookie because it was not set by my application/server -- I didn't notice that :(, because cookie domain was set to my web application server name.

This explains why I could not clear it or just create new cookie with the same name.

But second problem still exists -- why cookie name was encoded by VB6.

Grzegorz Gierlik