Can not clear the cookie form another application

A

ad

I use the codes below to clear the cookie["us_id"]:

HttpCookie myCookie = new HttpCookie("us_id");
myCookie.Expires = DateTime.Now.AddDays(-1d);
Response.Cookies.Add(myCookie);

It do well when the cookie is from the web application itself,
But fail to clear when the cookie is form another application, like php.

How can I do?
 
J

Joey

I had a similar problem once. I just changed the cookie name in my
web.config file to avoid any conflicts. That worked.
 
D

Dave Anderson

ad said:
I use the codes below to clear the cookie["us_id"]:

HttpCookie myCookie = new HttpCookie("us_id");
myCookie.Expires = DateTime.Now.AddDays(-1d);
Response.Cookies.Add(myCookie);

It do well when the cookie is from the web application itself,
But fail to clear when the cookie is form another application, like
php.
How can I do?

Make sure you use the same Domain and Path as the cookie you want to clear.



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
A

ad

I have double checkd the Domain and Path,
The domains of both are all null, and the Paths are all "/"



Dave Anderson said:
ad said:
I use the codes below to clear the cookie["us_id"]:

HttpCookie myCookie = new HttpCookie("us_id");
myCookie.Expires = DateTime.Now.AddDays(-1d);
Response.Cookies.Add(myCookie);

It do well when the cookie is from the web application itself,
But fail to clear when the cookie is form another application, like
php.
How can I do?

Make sure you use the same Domain and Path as the cookie you want to
clear.



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message.
Use of this email address implies consent to these terms. Please do not
contact me directly or ask me to contact you directly for assistance. If
your question is worth asking, it's worth posting.
 
A

ad

Thanks,
How to change the cookie name in web.config?


Joey said:
I had a similar problem once. I just changed the cookie name in my
web.config file to avoid any conflicts. That worked.
I use the codes below to clear the cookie["us_id"]:

HttpCookie myCookie = new HttpCookie("us_id");
myCookie.Expires = DateTime.Now.AddDays(-1d);
Response.Cookies.Add(myCookie);

It do well when the cookie is from the web application itself,
But fail to clear when the cookie is form another application, like php.

How can I do?
 
D

Dave Anderson

ad said:
I have double checkd the Domain and Path,
The domains of both are all null, and the Paths are all "/"

I find there is nothing like these two extensions for debugging this kind of
thing:
http://livehttpheaders.mozdev.org/
http://chrispederick.com/work/webdeveloper/



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
A

ad

Dose you mean the forms name in authentication section?
I have chane it , but still can't work



<authentication mode="Forms">
<forms name="xxxxxxx" loginUrl="Login.aspx" protection="Validation"
timeout="99999" defaultUrl="Home.aspx">






ad said:
Thanks,
How to change the cookie name in web.config?


Joey said:
I had a similar problem once. I just changed the cookie name in my
web.config file to avoid any conflicts. That worked.
I use the codes below to clear the cookie["us_id"]:

HttpCookie myCookie = new HttpCookie("us_id");
myCookie.Expires = DateTime.Now.AddDays(-1d);
Response.Cookies.Add(myCookie);

It do well when the cookie is from the web application itself,
But fail to clear when the cookie is form another application, like php.

How can I do?
 
A

ad

Can they be used in IE?


Dave Anderson said:
I find there is nothing like these two extensions for debugging this kind
of thing:
http://livehttpheaders.mozdev.org/
http://chrispederick.com/work/webdeveloper/



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message.
Use of this email address implies consent to these terms. Please do not
contact me directly or ask me to contact you directly for assistance. If
your question is worth asking, it's worth posting.
 
A

ad

Thanks.
What is Gecko browser ?


Dave Anderson said:
Not to my knowledge. But a Gecko browser should be part of your debugging
toolbox anyway, if only for testing compatibility.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message.
Use of this email address implies consent to these terms. Please do not
contact me directly or ask me to contact you directly for assistance. If
your question is worth asking, it's worth posting.
 
D

Dave Anderson

ad said:
Can they be used in IE?

Not to my knowledge. But a Gecko browser should be part of your debugging
toolbox anyway, if only for testing compatibility.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top