Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 13th, 2004, 06:13 AM
Registered User
 
Join Date: Aug 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default How Can I Delete Cookie files.

How Can I Delete Cookie files.
????? :)

 
Old June 20th, 2007, 11:15 AM
Registered User
 
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I know its been a long time since you started this thread but I'm looking to find a solution for the similar problem. I want to delete all cookies through my VB application.

If you managed to do it, please let me know how.


Thanks


 
Old June 21st, 2007, 03:13 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Here is a simple way

Sub Delete_Cookies()

Dim sRoot As String
Dim sCookiePath As String

On Error Resume Next

sRoot = Environ("USERPROFILE")

If Len(sRoot) = 0 Then Exit Sub

If Right$(sRoot, 1) <> "\" Then sRoot = sRoot & "\"

sCookiePath = sRoot & "Cookies\"

Kill (sCookiePath & "*.*")

End Sub

Cheers
Shasur

http://www.vbadud.blogspot.com
 
Old June 21st, 2007, 06:37 AM
Registered User
 
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Shasur,

Thanks for your reply. This partly solves my problem. Would you know how to delete the cookies received from a server during an active connection, rather then deleting all of the cookies.

For example if i'm browsing "abc.com" through a webbrowser component in visual basic. I want the application to delete all cookies received from the "abc.com" server straight after I close the session or navigate the browser to a different URL.

I know it sounds complex but I'm sure there's a way to catch the cookies dropped during a current session. I just cant find it :(


Thanks

Zeeshan



 
Old August 18th, 2007, 04:56 AM
Registered User
 
Join Date: Aug 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

u just transform this line

Kill (sCookiePath & "*.*")

to this:

Kill (sCookiePath & user & "@abc.com[1].txt"

where "user" find a module that finds the name of the computer u r on.






Similar Threads
Thread Thread Starter Forum Replies Last Post
delete cache files quickly Maxxim BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 September 4th, 2007 09:07 AM
Can't delete cookie...! Snib Beginning PHP 9 July 15th, 2007 10:32 PM
delete files in the server miguel.ossa Classic ASP Basics 1 September 5th, 2005 12:15 PM
Delete Files qazi_nomi Classic ASP Basics 7 October 18th, 2004 06:55 PM
How Can I Delete Cookie files. MICZ Pro VB 6 2 August 13th, 2004 10:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.