Solved

classic asp cookie not deleting

Posted on 2014-12-15
2
553 Views
Last Modified: 2014-12-15
I am setting a cookie in ASP like this:
 response.Cookies("auctionsession") = randomSessionVar
 Response.Cookies("auctionsession").Expires = Date() + 15
 Response.Cookies("auctionsession").Domain = ".oorahauction.org"

Then when they log out I try to delete the cookie this way
            response.Cookies("auctionsession") = ""
                         Response.Cookies("auctionsession").Expires = Date() -1
but my cookie isn't going away or clearing.
Am I missing something?
0
Comment
Question by:rivkamak
2 Comments
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 40501049
try

 Response.Cookies("auctionsession").Domain = ".oorahauction.org"
 Response.Cookies("auctionsession").Expires = Date() -1
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40501244
Note that 'Response.Cookies' MUST be done before any other non-ASP output.  You can Not set or delete a cookie after any page content has been sent.  It MUST be done before that.
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL to update characters in table column 6 128
If-Then-Else ASP problem 6 63
Help me. 3 56
Microsoft SQL ADO Conn Issue 6 48
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question