Solved

Cookie format has changed

Posted on 2011-09-08
11
277 Views
Last Modified: 2012-05-12
It used to be that IE cookies were stored in the users cookies folder (c:\users\username\cookies or c:\documents and settings\username\cookies) in the form: username@domainname e.g. admin@bbc.co[1].txt
Something has changed in the last few months so that the cookies are now stored in what appears to be a random letter and number format e.g. F6F3N6DQ.txt
There is no way of telling which cookie is which without opening each text file and inspecting the contents - and even then it's not obvious.
There now appears to be a new entry type in the temporary internet files cache folder e.g. cookie: admin@bbc.co.uk/
This is linked in some way to the relevant file in the cookies folder. For instance if you delete 'cookie: admin@bbc.co.uk' from temporary internet files folder it deletes F6F3N6DQ.txt in the cookies folder.
Therefore, the entire way IE stores cookies has been changed at some point - this has severely impacted several of our applications which rely on deleting cookies programatically (I am still having problems redesigning the apps to delete from the new locations - it appears you cannot now delete directly using the file system!)
Does anyone know when this change came about, the reasons behind it and whether it is possible to revert back to the previous system?
0
Comment
Question by:jamesrbourne
  • 6
  • 4
11 Comments
 
LVL 14

Expert Comment

by:binaryevo
ID: 36502315
How exactly is your application deleting cookies ( IE: paste the code )?   If you can give me some more technical details on the "how's" i can possibly help you minimize the impact of the changes that you would have to make.
0
 

Author Comment

by:jamesrbourne
ID: 36502488
Sample code to delete previous style cookies:

fs = CreateObject("Scripting.FileSystemObject")
ucl = ""
uclok = True
ucl = My.Computer.Registry.GetValue _                     ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "Cookies", Nothing)
'Strip trailing slash if present
If Right(ucl, 1) = "\" Then
     ucl = Left(ucl, Len(ucl) - 1)
End If
fs1 = ucl & "\*@bbc*.txt"
fs.DeleteFile(fs1)
0
 
LVL 66

Expert Comment

by:johnb6767
ID: 36505063
"This is linked in some way to the relevant file in the cookies folder. For instance if you delete 'cookie: admin@bbc.co.uk' from temporary internet files folder it deletes F6F3N6DQ.txt in the cookies folder."

FYI, "%userprofile%\local settings\temporary internet files" folder doesn't contain anything. It is a "Special" Shell Folder, which combines data from %userprofile%\cookies, and "Shell:cache\content.ie5" (just paste the paths into a RUN dialog)... The content.ie5 folder is hidden, and is not visible in the Folder Listing from the Temporary Internet Files folder contents. You have to add that in the Address bar, or type it directly.

Hence explaining why when you deleted it from the TIF folder, you really deleted it from the cookies folder...

And in Windows 7, it is "%userprofile%\AppData\Roaming\Microsoft\Windows\Cookies"
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:jamesrbourne
ID: 36505895
In reply to johnb6767:
Thanks, yes that explains the link but where is the reference ''cookie: admin@bbc.co.uk' being stored and how do you access it and match it to the actual cookie file.
As you say TIF is empty when read by the file system object so you seem to not be able to delete in the traditional manner. Any idea?
0
 
LVL 66

Expert Comment

by:johnb6767
ID: 36507722
In your script above you already have the location.....

"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "Cookies"

I still dont have an explanation as to the cookie formats changing... The only guess I can offer, is perhaps from either InPrivate Filtering, or from sites visited with Protected Mode enabled....
0
 

Author Comment

by:jamesrbourne
ID: 36508695
Thanks, johnb6767

This occurs without InPrivate filtering and occurs on XP as well as Win 7 - protected mode only available on Vista and above so it's nothing to do with that either.

I have a case open with MS regarding this and will post back any results but i'm surprised I cannot find more info regarding this change of cookie storage behaviour - anyone else please?
0
 
LVL 66

Expert Comment

by:johnb6767
ID: 36520635
I wish I had more for you.....
0
 

Author Comment

by:jamesrbourne
ID: 36548083
Microsoft have come back to me. The change in behaviour took place with cumulative security update MS11-057 released on 9 August 2011 see: http://support.microsoft.com/kb/2559049
This blog explains the cookie behaviour change: http://blogs.msdn.com/b/ieinternals/archive/2011/08/12/internet-explorer-9.0.2-update-changes-file-protocol-and-cookie-naming.aspx
Scroll down to 'Cookie Filenames are Randomized'
This has done wonders for my sanity!
So, it looks like you can no longer use filesystemobject to easily delete cookies, according to a filter, from the cookies folder- you can delete from the cache manually by going to the Temporary Internet Files. To programatically delete cookies they are recommending the WinInet functiions:
http://msdn.microsoft.com/en-us/library/aa452092.aspx
I'll be taking at look at this and will post if successful.
0
 
LVL 66

Expert Comment

by:johnb6767
ID: 36553240
Excellent to know.....

Heres another method that can be used for cookie cleaning.....

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2

0
 

Accepted Solution

by:
jamesrbourne earned 0 total points
ID: 36902149
Wininet is definitely the way to go with this - pretty complex and not for the faint hearted. As well as the MS article above these may be useful to anyone attempting to programme it:
http://msdn.microsoft.com/en-US/library/aa385134%28v=VS.85%29.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/aa385134%28v=vs.85%29.aspx
http://www.vbforums.com/showthread.php?t=588995
0
 

Author Closing Comment

by:jamesrbourne
ID: 36935090
MSDN support call opened with Microsoft which helped in explaining and solving this problem.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Tweak monitor detection / screen resolution 4 33
Windows updates batch files 7 44
C# Gridview 1 33
Sending receiving text messages in vb.net 15 37
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question