Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8167999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:22:42+00:00 2026-06-06T20:22:42+00:00

I am having a problem with deleting cookies in classic ASP. Setting and retrieving

  • 0

I am having a problem with deleting cookies in classic ASP. Setting and retrieving the cookies is working wonderfully, without problems, on multiple domains. Deleting the cookies is not.
The cookie that refuses to delete will time out and remove itself on the original timeout, but that is not an option.
I’ve looked through the documentation, stack overflow, Stack Exchange (web applications) (some of the problems are similar and gave me some of the answers, but not the same), cookie central, and MSDN.
Updating the pages to ASP.NET is not an option at this time.
The cookie values and names are in hexadecimal with a leading “O” to eliminate any possible problems with the encrypted data and the scripting languages (ASP, VBScript, Jsvascript, SQL) having problems with the characters.
Note that some of the different attempts are commented out.

Sub Set4HrCookie(ByVal CookieName, ByVal CookieValue)
    Response.Cookies(CookieName).Expires = DateAdd("n", 240, Now())
    Response.Cookies(CookieName).Domain = ".mydomain.net"
    Response.Cookies(CookieName).Path = "/"
    Response.Cookies(CookieName) = CookieValue
    Response.Cookies(CookieName).Secure = FALSE
End Sub

Sub Set1DayCookie(ByVal CookieName, ByVal CookieValue)
    Response.Cookies(CookieName).Expires = Now() + 1
    Response.Cookies(CookieName).Domain = ".mydomain.net"
    Response.Cookies(CookieName).Path = "/"
    Response.Cookies(CookieName) = CookieValue
    Response.Cookies(CookieName).Secure = FALSE
End Sub

Sub KillThatCookie(ByVal CookieName)
    Response.Cookies(CookieName).Domain = ".mydomain.net"
    Response.Cookies(CookieName).Path = "/"
    Response.Cookies(CookieName).Expires = Now() ' Now() - 1 ' #01/01/1999#
    ' Response.Cookies(CookieName).Secure = FALSE
    Response.Cookies(CookieName) = ""
End Sub

An example of a cookie that is refusing to delete:

O9DCCF20B15CA0F382184A96BAB
OFA86B660438C4863797E4485DE
mydomain.net/

The following are some of the URLs that gave me information.
You have to assign the .domainname.com domain when you clear them out otherwise it won’t clear them out.
http://forums.asp.net/t/1399232.aspx/1
Cookies with a DOMAIN value in classic ASP
http://blurbly.net/5_5.htm

Edit: Further tests have shown that because the “Path” was used on the cookie, the “Path” was required on the “Kill”.

Edit: This is IIS-6 – it appears to be similar to the known error with VB6 INI files. When a program hits the INI file too fast the system can’t keep up and INI file corruption happens.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T20:22:43+00:00Added an answer on June 6, 2026 at 8:22 pm

    At long last I found the answer. Our site was using both HTTPOnly cookies and standard cookies. The problem is that IIS can’t handle that. Either all cookies are HTTPOnly or none. One of them was being set both ways, all non-HTTPOnly cookies after that were not deleted.
    The KillThatCookie remains the same. The set cookie for one day becomes:

    Sub Set1DayCookie(ByVal CookieName, ByVal CookieValue)
    Dim strGMTDateRFC22
        strGMTDateRFC22 = GetServerUTC("d", 1) ' 1 Day Cart Session Expiration
        Response.AddHeader "Set-Cookie", CookieName & "=" & CookieValue & "; expires=" & strGMTDateRFC22 & "; domain=.mydomain.net; path=/; HttpOnly"
    End Sub
    

    Also, Cookies with an underscore “-‘, parenthesis”()”, ampersand “&” are problematic. They won’t necessarily delete. I’m sure that there are more characters, but the documentation says that these are valid. They may be valid, but they cause problems.

    edit: It appears that there is even more to it. The multiple timeout is also a problem.
    edit: Part of the problem is we’re encrypting the keys which makes it case sensitive.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having problem with the middle Div not expanding to the width http://acs.graphicsmayhem.com/images/middiv.jpg Ok, how
I am having problem using mvc:resources in spring 3.1 configuration. Initially i was working
I am having problem with drawing multiple lines during repaint. The code is as
I'm having a problem deleting rows from a datatable. In my program, I am
I'm having a problem because I'm deleting a Widget by using some_widget_instance.delete(). I also
I am having a problem with crystal reports because the records are not being
I'm having problems deleting a file from a higher directory, I found this post
I'm having a problem with my looping over a vector, and deleting values from
I'm having a problem designing part of my program (not writing it, for once!).
Having problems with the documentmanager upload trying to upload PDF's. The problem happens when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.