Eliminating Flash Cookies via the Command-Line

terminal screenshotIn a previous article I wrote about Flash-Cookies and some ways of controlling them from the desktop. Controlling Flash Cookies via the command-line is just as easy.

Basically for those working from a graphical desktop, dealing with flash-cookies means installing a browser plugin or accessing Adobe's control panel via their web-site. (Personally, I like the Mozilla-Firefox/BetterPrivacy-plugin combination).

Before you start, visit Adobe's Settings Manager Page to see your current cookie history.

It's been reported that Method 1 breaks flash on some sites, so I've updated the how-to to include some alternate suggestions.

Here is Method 1 for eliminating flash-cookies via the command-line, (in a terminal):

  1. For non-Ubuntu systems, go into superuser mode by typing:
    su
    Note:This step is not necessary in most cases, since you're only changing the setup for your /home user you won't need superuser privileges – I've just gotten so used to using su and sudo that I automatically include it in most of my terminal commands.
    If you're not sure, run the commands without superuser powers, if the system balks, change to superuser or sudo.
    Same applies to Ubuntu based systems – try without sudo, and use sudo only if the system demands it by preceding the commands with sudo
  2. In your terminal type:
    find -iname '*.sol'
    This command will list all the relevant folders.
  3. Backup, backup, backup - backup the relevant folders in case it becomes necessary to revert the changes:
    mkdir ./.macromedia.sav
    then:
    cp -a ./.macromedia/* ./.macromedia.sav/
  4. Now remove the ./.macromedia folders.
    rm -rf ./.macromedia You may or may not be familiar with warnings about using rm- rf – it's a very powerful command that deletes folders and files recursively so be very careful with it.
  5. Now the ./.macromedia folder needs to be linked to /dev/null.
    ln -s /dev/null ./.macromedia Check to make sure the command worked with:
    ls -al ./.macromedia Which should return a result ending with:
    ./.macromedia -> /dev/null

Voila. Flash Cookies will no longer be stored.
Check by visiting a flash-site. (eg: This Ted Talks Video of the Month), and visiting Adobe's Settings Manager page to see if any cookies are listed.

At this point you might be wondering what /dev/null is, so here's the definition:

In Unix-like operating systems, /dev/null or the null device is a special file that discards all data written to it (but reports that the write operation succeeded), and provides no data to any process that reads from it. – source: Wikipedia.

To undo Method 1:

  1. sudo rm -rf ./.macromedia
  2. mv ./.macromedia.sav ./.macromedia
  3. then

  4. chown yourusername:yourusername ./.macromedia

And since cleanliness is next to godliness, if everything worked ok and you're happy with the changes,
rm -rf ./.macromedia.sav to get rid of the old ./.macromedia folder.

Method 2

  1. Move to the .macromedia folder
    cd ~/.macromedia
  2. Remove the Flash_Player folder:
    sudo rm -rf Flash_Player
  3. Create a symbolic link to /tmp:
    ln -s /tmp Flash_Player

The Flash plugin should now happily use the /tmp folder to store flash-session data, and since /tmp is cleared on reboot, all the flash-cookies will be cleared when you log-out.
Source: Pallgone's Blog

To undo Method 2

  1. Move back to the macromedia folder:
    cd ~/.macromedia
  2. Have a look inside the folder, only Flash_Player should be there:
    ls -al
  3. Remove the symbolic link:
    sudo rm -rf Flash_Player
  4. Re-install the flashplugin to make sure the file hierarchy is as it needs to be:
    sudo apt-get install --reinstall flashplugin-nonfree
  5. Both of these methods will remove all flash-cookies from your system. They are "absolute". There are some situations in which you might want to keep certain flash-cookies on your system, and for those who do, the Firefox and BetterPrivacy Plugin combination is a very effective way of controlling what stays and what doesn't.

    Resources:

    1. Adobe's Setting Manager
    2. Pallgone's Blog
    3. The Inquirer – Banish Flash Cookies...
    4. WikiAnswers – What is /dev/null
    5. ghacks.net – article
    6. I'm a Super.com article

    As per usual, comments are welcome...

Comments

flash cookie removal

thanks, very nice

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.