I have two or three apps that i put into Application pool, so every site are differentiate by using slash /CONSUMER/, /CONSUMER2/, /LOGIN/ , and /MNT, i could only login from CONSUMER, how could i remove cookies (i want to remove userInfo and loginSeassion), from another applications pools, because at the productions after i'm using CONSUMER, the next things the apps will be redirect is to LOGIN app, but at the LOGIN app the cookies are not removed,
i'm using aspx.net and c# for visual studio 2008, the only i could do are using this code,
// Getting URL of the web
string urlScheme = HttpContext.Current.Request.Url.Scheme;
string urlAuthority = HttpContext.Current.Request.Url.Authority;
// Creating a request to retrieve cookies
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlScheme + "://" + urlAuthority);
// Get the cookies collection
HttpCookieCollection cookies = HttpContext.Current.Request.Cookies;
// Remove cookies based on scheme and authority
foreach (string cookieName in cookies.AllKeys)
{
HttpCookie cookie = cookies[cookieName];
if (cookie.Domain == urlAuthority && (urlScheme == "http" || urlScheme == "https"))
{
cookie.Expires = DateTime.Now.AddDays(-1);
HttpContext.Current.Response.Cookies.Add(cookie);
}
}