In order to be able to speed up user logging times for our product we are trying to implement a preloaded user session scheme. In order to be able to migrate browsing preferences from the preloaded user to the real one we need to be able to edit the contents of the 开发者_JAVA百科C:\Documents and Settings\User1\Cookies folder: cookie files + index.dat.
In order to achieve this we tried to replace all occurrences of “User1” with say “User2” for cookie files and index.dat. Since both user names have the same character length this change should no break the binary integrity of index.dat file. However after performing this change the cookies no longer work .. Any suggestion would be appreciated.
Editing index.dat seems hopless. The format has never been made public. Trying to reverse engineer it has only resulted in limited sucess: http://www.latenighthacking.com/projects/2003/reIndexDat/ However there are the Microsoft APIs: FindFirstUrlCacheEntry, FindNextUrlCacheEntry, InternetGetCookie, InternetSetCookie that can be used to export and import cookie data.
精彩评论