Sign in to follow this  
Followers 0
JBeardNC

Delete Specific Cookies

6 posts in this topic

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?

Share this post


Link to post
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

Share this post


Link to post
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?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Nevermind... simple Google search reveals the location of cookies on Windows 7 PC's. I modified the variable and I'm good to go. Thanks!!!

Share this post


Link to post
Share on other sites

Nevermind... simple Google search reveals the location of cookies on Windows 7 PC's. I modified the variable and I'm good to go. Thanks!!!

Please post your script adapted for all OS...this may help others ! Posted Image


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

Share this post


Link to post
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
Sign in to follow this  
Followers 0