Print Page | Close Window

ASP Cookie delete

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=31354
Printed Date: 14 April 2024 at 11:27am
Software Version: Web Wiz Forums 12.07 - https://www.webwizforums.com


Topic: ASP Cookie delete
Posted By: aspco
Subject: ASP Cookie delete
Date Posted: 05 April 2016 at 5:21pm

Receive data:
gelenveri=request.form("veriA")
Response.Cookies("demo")(gelenveri)=gelenveri

List data:
ForEach yaziver in Request.Cookies("demo")
Response.write yaziver
Next

Output:
Cigaret
L
ighter
Servitude

Delete item:
Gelenveri=request.form("veriA")
Response.Cookies("demo")(gelenveri)=""

I want to delete lighter but deletion does not occur!
How to do?



Replies:
Posted By: WebWiz-Bruce
Date Posted: 06 April 2016 at 1:27pm
You are probably better deleting the cookie and recreating rather than  trying to modify it.

Why are you storing data in a cookie?

This is a bad way to store data and should be avoided if you can as cookie carry allot of overhead as they need to be set back and forth between the server and the web browser for each connection to the website. So if a page has 30 images the cookie would be sent to the server 30 times for each connection.

In addition the data can be read and modified by the visitor on their computer so is not secure or reliable.

As long as the data does not need to be persistent and stored on the visitors computer for multiple visits to the website I would say you would be better off storing the data in a session variable.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: aspco
Date Posted: 06 April 2016 at 7:08pm
Thank you, my friend.
I'll try a different method...

Stay with love.



Print Page | Close Window

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