View Full Version : Delete specific cookie
webcrtor
03-11-2010, 11:31 AM
My question is pretty simple but I don't know how to script it, I'm pretty new to this.
So what I would like to do is when you press the exit button, it searches for a specific cookie that was created by a site visited with the web plugin(so IE cookie) and deletes it.
Any help is greately appreciated!
jassing
03-11-2010, 11:47 AM
local cFolder = Shell.GetFolder(SHF_MYDOCUMENTS); -- this is c:\documents and settings\username\my documents.
cFolder = cFolder.."\\..\\cookies\\" -- now we're pointing at the cookies folder
local cFile = cFolder .. "MyCookie[1].txt";
File.Delete( cFile )
webcrtor
03-11-2010, 11:59 AM
But this only works for xp right? since vista and seven store it in the roaming folder.. isn't there a command that automaticly finds the cookie folder no matter what os you are on? eg. %ProgramFilesFolder%
jassing
03-11-2010, 12:02 PM
correct - you would need to craft it.
You could use File.Find() to look for hte cookie since you know what it is.
There is no var, nor do I think should be.
Opera, Mozilla, Firefox, Chrome,IE, etc dont' store their cookies in the same folder.
it's not that hard to do a little if/then/else to to work for various os's.
That would be better than file.find() but if you're lazy; file.find() would work; just start in the same users base folder .. which is available via api's.
Powered by vBulletin™ Version 4.0.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.