473,548 Members | 2,697 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting rid of session cookie ("ASP.NET_Sessi onId")

Hi all,

I have an application that when finished redirects to a non-ASP.NET app
which is choking on a huge ASP.NET session cookie. The cookie
"ASP.NET_Sessio nId" gets transmitted by the browser (IE6 in test case)
despite trying Microsoft's suggested method of expiring the cookie first.

I'd like to be able to kill the cookie and do a Response.Redire ct() from
within a server-side button handler, but I'm to the point now where I'm
instead redirecting to a third .aspx page whose only job is to remove the
cookie and have a hyperlink out. In its Page_Load:

{
System.Web.Http Context.Current .Session.Abando n();

HttpCookieColle ction cookieColl = HttpContext.Cur rent.Request.Co okies;
String[] names = cookieColl.AllK eys;
System.Web.Http Context.Current .Trace.Write(St ring.Format("{0 } cookies:",
names.Length));
for (int i = 0; i < names.Length; i++) {
HttpCookie cookie = cookieColl[names[i]];
System.Web.Http Context.Current .Trace.Write(St ring.Format(" {0}",
names[i]));
cookie.Expires = DateTime.Now.Ad dDays(-1);
cookie.Domain = "invaliddomain" ;
cookie.Path = "invalidpat h";
cookie.Value = "invalidval ue";
Response.Cookie s.Add(cookie);
}
}

.... but on clicking the hyperlink, the cookie yet lives.

Any ideas? Is this something specific to IE6 perhaps, some security update
that special-cases ASP.NET cookies? Any help is appreciated.

Thanks,
--Dan Michaeloff
Nov 19 '05 #1
1 9181
Daniel Michaeloff wrote:
Hi all,

I have an application that when finished redirects to a non-ASP.NET
app which is choking on a huge ASP.NET session cookie. The cookie
"ASP.NET_Sessio nId" gets transmitted by the browser (IE6 in test case)
despite trying Microsoft's suggested method of expiring the cookie
first.

I'd like to be able to kill the cookie and do a Response.Redire ct()
from within a server-side button handler, but I'm to the point now
where I'm instead redirecting to a third .aspx page whose only job is
to remove the cookie and have a hyperlink out. In its Page_Load:

{
System.Web.Http Context.Current .Session.Abando n();

HttpCookieColle ction cookieColl =
HttpContext.Cur rent.Request.Co okies; String[] names =
cookieColl.AllK eys;
System.Web.Http Context.Current .Trace.Write(St ring.Format("{0 }
cookies:", names.Length)); for (int i = 0; i < names.Length; i++) {
HttpCookie cookie = cookieColl[names[i]];
System.Web.Http Context.Current .Trace.Write(St ring.Format("
{0}", names[i]));
cookie.Expires = DateTime.Now.Ad dDays(-1);
cookie.Domain = "invaliddomain" ;
cookie.Path = "invalidpat h";
cookie.Value = "invalidval ue";
Response.Cookie s.Add(cookie);
}
}

... but on clicking the hyperlink, the cookie yet lives.

Any ideas? Is this something specific to IE6 perhaps, some security
update that special-cases ASP.NET cookies? Any help is appreciated.

Thanks,
--Dan Michaeloff


What probably happens is that the ASP.Net system automatically
adds that cookie, overwriting your "remove this cookie" version.

Try adding a "EnableSessionS tate=False" to the @ Page directive in the aspx,
maybe this will get rid of the new session cookie.

Hans Kesting
Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5192
by: Mindful_Spirit | last post by:
I'm trying to set up a basic email feed back form like this, and was wondering about some basic configuration settings. I have used code from this website. I have it working just fine. I'm running IIS on my home machine. My problem is that I need to upload this stuff to a webhosting place and register a domain and I'm not sure what to...
8
5722
by: whtevr | last post by:
Consider this HTML on an ASP page called default.asp in a virtual directory: <FORM name="Flogin" id="Flogin" action="" method=post> </FORM> Do I HAVE to put the literal "default.asp" into the action attrib to get this form to post back to the "default.asp" page in that directory?
0
2550
by: Joeyej | last post by:
Hi - I'm trying to move/use a web form (containing some javascript field checks) previously hosted on a Windows 2000 server. However, the FORM METHOD="post..." command in the form (shown below) now renders "Page not Found" when launched on the new Windows 2003 server (ws-server1). The form is designed to use the write.asp program to write...
1
1419
by: Edward King | last post by:
I have a statement in a asp,like follows£º var str=window.top.main.document.all.contenttext.value; I use IIS5.0 to deploy this asp,then I visit this asp like follows: http://localhost/test/default.asp I found I can get this page,then I use my computer's IP address, http://192.168.0.3/test/default.asp I got errors! It said "no...
2
6792
by: McKirahan | last post by:
If I have a Web page invoked via http://myDomain.com/What.htm that references an ASP page via the <img> tag's "src=" like this: <html> <head> <title>Page.htm</title> </head> <body> <img src="http://myDomain.com/Page.asp" border="0" width="0" height="0" alt="">
4
2027
by: keithb | last post by:
It looks like the span tag cannot be used with asp tables. What is the best way to make an irregular asp table? Thanks, Keith
1
1275
by: Electric Co. | last post by:
Hello, I have two questions: 1.) Could I create a custom server control in 2005 in order to leverage the CompositeControl base class and then use that control in 2003? (fingers crossed but guessing aboslutely not) 2.) How good does ASP.NET 2005 handle a custom composite control inside of a custom composite control ?
1
1746
by: mark4asp | last post by:
Which should I use: 1. "ASP.NET AJAX-Enabled Web Site" or 2. "AJAX Control Toolkit Web Site"? In the first, controls from the control toolkit start as: <cc1:SomeControl></cc1> In the 2nd, those controls are: <ajaxToolkit:SomeControl></ ajaxToolkit>
0
2437
by: Crash | last post by:
..NET Framework 1.x, 2.x, 3.x... ASP.NET 5.0, 5.1, 6.0... Windows Server 2000, XP, Server 2003... I am using NAnt & the NAnt contrib library to automate virtual directory maintenance tasks on IIS servers with side-by-side installs of ASP.NET. I can automate most IIS tasks using NAnt however - to configure the ASP.NET version for a newly...
0
7711
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7954
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7467
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7805
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6039
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5367
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5085
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3478
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
755
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.