Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1109
  • Last Modified:

classic asp cookie not deleting

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
rivkamak
Asked:
rivkamak
1 Solution
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
try

 Response.Cookies("auctionsession").Domain = ".oorahauction.org"
 Response.Cookies("auctionsession").Expires = Date() -1
0
 
Dave BaldwinFixer of ProblemsCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now