[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

delete cookie

aidy

6/5/2008 4:42:00 PM

Hi,

Does anyone know of an effective way to delete cookies?

I have been using this:

<code>
class Cookie
def kill (dir= "C:\\Documents and Settings\\"+ENV['USERNAME']+"\Local Settings\\Temporary Internet Files")
require 'fileutils'
FileUtils.rm_rf dir
end
</code>

But doesn't seem to always work

Aidy
1 Answer

Phillip Gawlowski

6/5/2008 5:02:00 PM

0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

aidy wrote:
| Hi,
|
| Does anyone know of an effective way to delete cookies?
|
| I have been using this:
|
| <code>
| class Cookie
| def kill (dir= | "C:\\Documents and Settings\\"+ENV['USERNAME']+"| \Local Settings\\Temporary Internet Files")
| require 'fileutils'
| FileUtils.rm_rf dir
| end
| </code>
|
| But doesn't seem to always work

What are the error messages you get, if any?

Remember, if a file is in use, you cannot delete it (OS level lock), and
it may be possible that Internet Explorer is still running.

Another way to accomplish what you could be the win32ole library, to use
IE to delete the cookies.


- --
Phillip Gawlowski
Twitter: twitter.com/cynicalryan
Blog: http://justarubyist.bl...

~ Why waste time learning, when ignorance is instantaneous?
-- Calvin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail....

iEYEARECAAYFAkhIHE0ACgkQbtAgaoJTgL+I5wCfXx6ZXyAgOOJjctajfMRFqdlq
5AkAn37TYiCEEHp4C0U2QaGhqInpxBTV
=FnhJ
-----END PGP SIGNATURE-----