acess Posts

Is it possible to acess to computer cookies using a java app?

Question by flf.neo4: Is it possible to acess to computer cookies using a java app?
I want to make a java app that acesses to cookies stored in the computer, is it possible without need to provide the path to the folder? (it changes from os to os and from browser to browser…)

Best answer:

Answer by Unca Alby
If you’re talking about writing a standalone Java application that runs on the PC, you have a few issues to address.

One, you’ve already mentioned, the OS/browser specific location. Your best bet is just to find out where each of them are for each popular OS/browser and keep the path for each in an internal database. Then those particular OS/browser combinations become the “official” set that your application supports. Be ready to add more paths as the need arises, since we seem to be in an age where every Tom, Dick and Harry wants to invent his own browser.

Two, you may need to read the Windows Registry for cases where people have installed their OS on the “D:” drive instead of the “C:” drive, if you really want this to be all-inclusive. It doesn’t happen often, but it does happen. Also check the browser to see if the user is allowed to configure the path for temporary files. That information is probably kept in the Registry also.

Three, you may run into permission problems, especially if you want to read the cookies left for a different user on that machine. Vista and Windows 7, for example, I’m pretty sure will not allow any access by default. Indeed, they *might* not even let you read *your* cookies.

But other than that, there shouldn’t be any problems. After all, they are ONLY small files kept on disk. Java even has some libraries that will easily parse the format for you.

So basically, the actual answer to your question, “Is it possible,” is “Yes.”

What do you think? Answer below!

Posted by in Popular Cookies and tagged with acess, computer, cookies, java, possible, using