# Deleting Cookies

**URL:** <https://www.ruby-forum.com/t/deleting-cookies/163644>\
**Category:** Ruby\
**Created:** [March 23, 2009, 3:05pm UTC](https://www.ruby-forum.com/t/deleting-cookies/163644 "2009-03-23T15:05:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![indium](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/35a633/32.png) [@indium](https://www.ruby-forum.com/u/indium)\
**Post date:** [March 23, 2009, 3:05pm UTC](https://www.ruby-forum.com/t/deleting-cookies/163644/1 "2009-03-23T15:05:31Z")

</div>

Hi All,

My requirement is deleting cookies and cache.

I tried with the following code

CODE:  
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  
Dir.chdir(“C:\Documents and Settings\venkat\Local Settings\Temporary  
Internet Files\”)  
target\_dir\_files = Dir.glob("\*");

puts("###################")  
puts target\_dir\_files  
puts("###################")  
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

and then to delete with File.Delete(filename)

But I am getting output as

Output  
###################  
AntiPhishing  
Content.IE5  
Content.MSO  
desktop.ini  
OLK10FB  
###################

I need to delete the cookies and cache. Is my way correct? Is there any  
other best method to do this kindly throw some light on it

Thanks,  
Venkat
