Print Page | Close Window

Delete Cookies

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=10007
Printed Date: 31 March 2026 at 4:33pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Delete Cookies
Posted By: zMaestro
Subject: Delete Cookies
Date Posted: 15 April 2004 at 3:34am

Hi all,

I want to delete a cookies at the top of a certain page (Signup page), I'm not familiar with cookies, so what's the best way to do so:

  • Response.Cookies("SiteCookies") = ""

or

  • Response.Cookies("SiteCookies").Expires=Now

or there is other code to delete cookies?

thanks.




Replies:
Posted By: Mart
Date Posted: 15 April 2004 at 3:40am
Either will do the job


Posted By: KCWebMonkey
Date Posted: 15 April 2004 at 9:21am
ASP cookies almost always end up buggy and less reliable. if possible, i'd use JavaScript cookies instead...


Posted By: zMaestro
Date Posted: 15 April 2004 at 12:16pm

Originally posted by KCWebMonkey KCWebMonkey wrote:

ASP cookies almost always end up buggy and less reliable. if possible, i'd use Java Script cookies instead...

Is there any tutorials for JavaScript Cookies??! or can you post it here :)



Posted By: Mart
Date Posted: 15 April 2004 at 12:21pm
Here's how to set them (ripped from devjunkies.com)


<script language="javascript">
function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
</script>


Then <a onclick="javascript:SetCookie('Name', 'Value');">

You should be able to work out how to read cookies from that aswell.



Posted By: KCWebMonkey
Date Posted: 15 April 2004 at 1:32pm

here's a good tutorial for javascript cookies

http://hotwired.lycos.com/webmonkey/98/29/index1a_page7.html?tw=programming - http://hotwired.lycos.com/webmonkey/98/29/index1a_page7.html ?tw=programming




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net