[lnkForumImage]
TotalShareware - Download Free Software

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


 

BeeJ

3/1/2012 8:03:00 PM

My VB6 app scans folders and deletes, or not, some files per user
command.
But how do I tell if a file is a Cookie?

I used Windows Explorer and it has column headers
Name Internet Address Type ....

none of those have a consistent naming that allows me to determine if
they are truely cookies. Some names do not have cookie: prefixed.

When I right-click properties it might give me a filename such as
ruapp.txt

Are all cookies .txt?
Do I have to open all files to see if they are cookies?
When I open them they are not readable text files and I do not see any
consistent contents to id as a cookie.
So how do that all work?
I have not found any attributes that id a cookie.

Tx


12 Answers

Henning

3/2/2012 12:35:00 AM

0


"BeeJ" <nospam@spamnot.com> skrev i meddelandet
news:jiokle$5jn$1@speranza.aioe.org...
> My VB6 app scans folders and deletes, or not, some files per user command.
> But how do I tell if a file is a Cookie?
>
> I used Windows Explorer and it has column headers
> Name Internet Address Type ....
>
> none of those have a consistent naming that allows me to determine if they
> are truely cookies. Some names do not have cookie: prefixed.
>
> When I right-click properties it might give me a filename such as
> ruapp.txt
>
> Are all cookies .txt?
> Do I have to open all files to see if they are cookies?
> When I open them they are not readable text files and I do not see any
> consistent contents to id as a cookie.
> So how do that all work?
> I have not found any attributes that id a cookie.
>
> Tx
>
>
AFAIK
Cookies are plain textfiles .txt
The are in \Documents And Settings\UserName\CookiesThere is an index.dat file with all cookie files in it.
Readable as UTF8. They all start with, for me, some unreadable characters +
ookie:filename.txt

/Henning


BeeJ

3/2/2012 1:35:00 AM

0

> AFAIK
> Cookies are plain textfiles .txt
> The are in \Documents And Settings\UserName\Cookies> There is an index.dat file with all cookie files in it.
> Readable as UTF8. They all start with, for me, some unreadable characters +
> ookie:filename.txt
>

"Cookie..." is not the file name.
What Win are you on? I'm on XP Pro latest SP.

I think the true location or a link is elsewhere.

I can delete cookies in this folder and he cookie is gone.
C:\Documents and Settings\Administrator\Local Settings\Temporary
Internet Files


MikeD

3/2/2012 1:54:00 AM

0



"BeeJ" <nospam@spamnot.com> wrote in message
news:jip84f$rn4$1@dont-email.me...
>> AFAIK
>> Cookies are plain textfiles .txt
>> The are in \Documents And Settings\UserName\Cookies>> There is an index.dat file with all cookie files in it.
>> Readable as UTF8. They all start with, for me, some unreadable characters
>> + ookie:filename.txt
>>
>
> "Cookie..." is not the file name.
> What Win are you on? I'm on XP Pro latest SP.
>
> I think the true location or a link is elsewhere.
>
> I can delete cookies in this folder and he cookie is gone.
> C:\Documents and Settings\Administrator\Local Settings\Temporary Internet
> Files

The actual location will vary from one version of Windows to another. For
example, the path you stated would be correct for Window XP when logged on
as the Administrator user. But, on Win7, it's going to something like
"C:\Users\{username}\AppData\Roaming\Microsoft\Windows\Cookies"

It's going to be different for each Windows user. To get the exact path,
you'll need to use any of a number of Windows API functions (such as
SHGetSpecialFolderPath).

Also, different browsers MAY save cookies to a different folder entirely. I
don't know if they do or not, but there's certainly nothing forcing them to
save cookies in the folder that Microsoft says to.

Mike


unknown

3/2/2012 2:22:00 AM

0

"BeeJ" <nospam@spamnot.com> wrote in message
news:jip84f$rn4$1@dont-email.me...
> "Henning" <computer_hero@coldmail.com> wrote in message
> news:jip4iv$bpr$1@dont-email.me...
>

Fixed missing reply-to person. See below.

>> AFAIK
>> Cookies are plain textfiles .txt
>> The are in \Documents And Settings\UserName\Cookies>> There is an index.dat file with all cookie files in it.
>> Readable as UTF8. They all start with, for me, some unreadable characters
>> + ookie:filename.txt
>>
>
> "Cookie..." is not the file name.
> What Win are you on? I'm on XP Pro latest SP.
>
> I think the true location or a link is elsewhere.
>
> I can delete cookies in this folder and he cookie is gone.
> C:\Documents and Settings\Administrator\Local Settings\Temporary Internet
> Files

The one that Henning posted is the real one. The one that you posted is a
fake display handled by a shell extension, similar to some FTP programs that
view folders as if they are part of your computer. See "Namespace
Extensions" in MSDN Library Index for more details.



BeeJ

3/2/2012 3:47:00 AM

0

>>
>> I can delete cookies in this folder and he cookie is gone.
>> C:\Documents and Settings\Administrator\Local Settings\Temporary Internet
>> Files
>
> The one that Henning posted is the real one. The one that you posted is a
> fake display handled by a shell extension, similar to some FTP programs that
> view folders as if they are part of your computer. See "Namespace Extensions"
> in MSDN Library Index for more details.

But if I delete a cookie in that folder it is deleted. So is windows
redirecting the process to the actual file and deleting there?

But bottom line, I do not care where a cookie is.

My original question still goes unanswered.
How do i tell if a file I am lokking at is a cookie?


unknown

3/2/2012 4:14:00 AM

0

"BeeJ" <nospam@spamnot.com> wrote in message
news:jipfqt$rbg$1@dont-email.me...
>>>
>>> I can delete cookies in this folder and he cookie is gone.
>>> C:\Documents and Settings\Administrator\Local Settings\Temporary
>>> Internet Files
>>
>> The one that Henning posted is the real one. The one that you posted is a
>> fake display handled by a shell extension, similar to some FTP programs
>> that view folders as if they are part of your computer. See "Namespace
>> Extensions" in MSDN Library Index for more details.
>
> But if I delete a cookie in that folder it is deleted. So is windows
> redirecting the process to the actual file and deleting there?

The shell extension takes the delete request and redirects it if you are
using Windows Explorer. If you are using VB, I don't think you will see the
fake list of files and folders inside "Temporary Internet Files", but you
will see the real thing. Try this sample code and see what it prints. You
will also the same thing if you are using Command Prompt and Dir rather than
Windows Explorer.

Option Explicit

Private Sub Form_Load()
Dim MyFile, MyPath, MyName

MyPath = "C:\Documents and Settings\Administrator\Local
Settings\Temporary Internet Files\"
MyName = Dir(MyPath, vbDirectory Or vbHidden Or vbSystem)
Do While MyName <> "" ' Start the loop.
' Ignore the current directory and the encompassing directory.
If MyName <> "." And MyName <> ".." Then
' Use bitwise comparison to make sure MyName is a directory.
If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then
Debug.Print MyName ' Display entry only if it
End If ' it represents a directory.
End If
MyName = Dir ' Get next entry.
Loop

End Sub



>
> But bottom line, I do not care where a cookie is.
>
> My original question still goes unanswered.
> How do i tell if a file I am lokking at is a cookie?

MikeD answered that. Use SHGetSpecialFolderPath(CSIDL_COOKIES) to get the
folder, and any file inside that is a cookie.


Dee Earley

3/2/2012 10:07:00 AM

0

On 02/03/2012 03:46, BeeJ wrote:
>>>
>>> I can delete cookies in this folder and he cookie is gone.
>>> C:\Documents and Settings\Administrator\Local Settings\Temporary
>>> Internet Files
>>
>> The one that Henning posted is the real one. The one that you posted
>> is a fake display handled by a shell extension, similar to some FTP
>> programs that view folders as if they are part of your computer. See
>> "Namespace Extensions" in MSDN Library Index for more details.
>
> But if I delete a cookie in that folder it is deleted. So is windows
> redirecting the process to the actual file and deleting there?
>
> But bottom line, I do not care where a cookie is.
>
> My original question still goes unanswered.
> How do i tell if a file I am lokking at is a cookie?

For IE, because it'll be in the cookie folder.
(Other browsers will vary or use completely different methods altogether)

--
Deanna Earley (dee.earley@icode.co.uk)
i-Catcher Development Team
http://www.icode.co.uk...

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)

BeeJ

3/2/2012 10:27:00 PM

0

Yes, I know other browsers use other paths to store cookies.

Someone has figued it out otherwise apps like CCleaner would not work.

I want to be able to protect cookies but delete other files.


BeeJ

3/2/2012 10:32:00 PM

0

My app already finds the IE temp folder using windows to tell me and
deletes files there but I am trying to protect cookies (if the user so
desires).
I also know to path to other browser temp folders.

Bottom line I am still trying to figure out if a file is a cookie or
not. With IE I know how to make a list of all cookies so I could get
the list the see if the potential deletion is one of the cookies but
was looking for a more general cookie test. e.g. look at contents to
determine if a cookie.


Henning

3/2/2012 10:47:00 PM

0


"BeeJ" <nospam@spamnot.com> skrev i meddelandet
news:jirhfu$112$1@speranza.aioe.org...
> Yes, I know other browsers use other paths to store cookies.
>
> Someone has figued it out otherwise apps like CCleaner would not work.
>
> I want to be able to protect cookies but delete other files.
>
>
Persistant cookies would not be stored in temp folders.

/Henning