Jump to content

Delete Specific Cookies


JBeardNC
 Share

Recommended Posts

I did a search for deleting cookies and I found ways to delete ALL cookies but wondering if anyone knows of a way to delete specific cookies. I need to delete, for example, any cookies like "*.google.com"

I tried using the FileListToArray function on my Cookies folder (Temporary Internet Files folder on Windows 7) and it doesnt seem to work like it does on any other folder.

Any thoughts?

Link to comment
Share on other sites

Like this ?

_DeleteCookies ( "@google" )


Func _DeleteCookies ( $_String )
    ; google cookies
    ; C:\Documents and Settings\Administrateur\Cookies\administrateur@google.co[1].txt
    ; C:\Documents and Settings\Administrateur\Cookies\administrateur@google[2].txt
    ; C:\Documents and Settings\Administrateur\Cookies\administrateur@google[3].txt
    $_CookiesDir = @UserProfileDir & '\Cookies'
    ;ConsoleWrite ( "$_CookiesDir : " & $_CookiesDir & @Crlf )
    $_TxtFileArray = _FileListToArray ( $_CookiesDir, '*.txt' ) ; _ArrayDisplay ( $_TxtFileArray )
    For $_T = 1 To UBound ( $_TxtFileArray ) -1
       If StringInStr ( $_TxtFileArray[$_T], $_String ) <> 0 Then FileDelete ( $_CookiesDir & '\' & $_TxtFileArray[$_T] )
    Next    
EndFunc ;==> _DeleteCookies ( )

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Awesome!! That works great on an XP machine. Can't get it to work on Windows 7 though. The @UserProfileDir & '\Cookies' folder apparently does not exist or something because if I try and browse to that, I get access denied (strange). Any thoughts on how to get it to work on W7?

Link to comment
Share on other sites

Awesome!! That works great on an XP machine. Can't get it to work on Windows 7 though. The @UserProfileDir & '\Cookies' folder apparently does not exist or something because if I try and browse to that, I get access denied (strange). Any thoughts on how to get it to work on W7?

I can't help you for 7, I'm on xp ! Posted Image

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...