So I have this code on an old ASP page which I recently updated because we are migrating, and I have set the domain of the cookie to include any subdomains:
Response.cookies("PERSID") = PERSID
if Temporary =false then
Response.Cookies("PERSID").Expires = DateAdd("d", cookieExpires, Date)
end if
Response.Cookies("PERSID").Domain = Domainname
'Where domainname is ".mydomain.com"
The problem is I cannot for the life of me find a way to delete this cookie via ASP.
The traditional overwrite with empty value and set expire to yesterday doesnt' work. The cookies just stare back at me and laugh.
daxmax
Member
67 Points
30 Posts
Classic ASP > can't delete cookies where domain is set
Mar 19, 2009 03:54 PM|LINK
So I have this code on an old ASP page which I recently updated because we are migrating, and I have set the domain of the cookie to include any subdomains:
Response.cookies("PERSID") = PERSID
if Temporary =false then
Response.Cookies("PERSID").Expires = DateAdd("d", cookieExpires, Date)
end if
Response.Cookies("PERSID").Domain = Domainname
'Where domainname is ".mydomain.com"
The problem is I cannot for the life of me find a way to delete this cookie via ASP.
The traditional overwrite with empty value and set expire to yesterday doesnt' work. The cookies just stare back at me and laugh.
Response.cookies("PERSID") = ""
Response.Cookies("PERSID").Expires = Date() -1
I tried setting the domain level prior to clearnig it but that doesn't do much.
Does anyone have any ideas how to eliminate these cookies?
Classic ASP cookies subdomain delete
daxmax
Member
67 Points
30 Posts
Re: Classic ASP > can't delete cookies where domain is set
Mar 19, 2009 05:32 PM|LINK
ok I figured it out. You have to assign the .domainname.com domain when you clear them out otherwise it won't clear them out.
swetachotali...
Member
4 Points
2 Posts
Re: Classic ASP > can't delete cookies where domain is set
Dec 15, 2010 09:51 AM|LINK
I am using asp.net and need to delete cookies having subdomain assigned. How to assign domain name while removing the cookies ?