Wednesday, December 17, 2008

How to Delete Flash Shared Objects

I just had my first run in with shared objects. The client wants the user to see a video the first time they open the homepage and then to see page2 for every other time the user opens the homepage. I had read about sharedObjects before and by referencing the help docs they were pretty easy to implement.

However, attempting to remove the little buggers is a different story. I figured I would just need to clear my cookies and reload the page. Nope. Hmmm, clear cache and reload? Not so much. Clear everything? Offline Content, Search History, Browsing History, etc? No, No, and more no. Those buggers are like cockroaches.

Turns out with a little research I found out that Flash Objects are their own beast. They live outside the browser and therefore are not controlled or contained by the browser. Fair enough.

For Windows users you can find these guys hiding in the following default location:

Windows Vista:
C:\Users\userName\AppData\Roaming\Macromedia\Flash Player\#SharedObjects

Windows XP:
Documents and Settings\userName\Application data\Macromedia\Flash Player\#SharedObjects


The first time I opened that folder was a bit scary. Its amazing how many sites have been collecting information about me without me knowing. I thought I was somewhat safe by deleting cookies, little did I know I had all these friends hiding in my application folder.

To remove them you just simply delete them from their corresponding folder. Next time you visit the site they will be recreated automatically.

You can learn more about Managing Shared Objects at Adobe's help Center.

You can also change your SharedObject settings by visiting Adobe Flash Player's Settings Manager.

20 comments:

  1. On MAC OS X you can find #SharedObjects at
    /Users/username/Library/Preferences/Macromedia/Flash Player

    Yakov Fain

    ReplyDelete
  2. to delete with actionscript

    put the code in a frame

    mso = SharedObject.getLocal //("SUserName", "/"); // shared object name
    delete mso.data.myname;
    mso.flush();

    ReplyDelete
  3. Or you can use the Objection Firefox add-on.

    With this you can view .sol values and selectively or entirely delete .sol files.

    Cheers,
    Aran

    ReplyDelete
  4. @Yakov
    Thanks! Didn't have that handy.

    @Brent
    I think that would just delete the myname attribute of the SUserName shared object. I would think the object would remain. From the help docs it looks like you would need to call mso.clear() instead of flush since flush writes the data.

    @Aran
    Thanks for the link. I had opened one up in wordpad and could see the different elements but it was also scattered with crazy characters. Sounds like this would be much easier.

    ReplyDelete
  5. FWIW, CCleaner (a free Windows utility) can clean out cookies in IE, FF, Opera, Safari, and Flash.

    Not much help if you wanna do it from within your code, but if you just want to make sure you have a "clean slate" of browser cache and cookies, it does the job.

    ReplyDelete
  6. I did a similar post about the location of shared objects. You can read it here ...

    http://www.adrianparr.com/?p=19

    ReplyDelete
  7. It doesn't seem to be in the same location by the looks of things for developers using Flash - would I be right in saying this is for the flash player that is accessed by browsers?

    Anyone know where this location is stored for the Flash Pro 8 IDE? and also when testing Flash Lite in the IDE environment on the PC?

    I'm pretty sure this being a completely different environment, it might be in a different location...

    ReplyDelete
  8. @derek
    Check out a folder called "localhost" within the directory mentioned above. All your dev stuff while working on your local machine will be there.

    ReplyDelete
  9. The easiest and most effective way (I'm a lazy person) is to remove the write authority on the

    C:\Documents and Settings\USERNAME\Application Data\Macromedia\Flash Player

    Directory. All of your online bank sites still work.. because not all people have flash installed, and not all browser types support flash.

    ReplyDelete
  10. @anon
    That wouldn't delete them, sounds like it would just prevent new ones from being added. Which is good to know, but not exactly what I was going for.

    Banks would use cookies. Cookies are a different breed than shared objects... they can be controlled and deleted via your browser.

    ReplyDelete
  11. Looks like Bank of America has a new location for the FSO.

    Application Data\Adobe\Flash Player\AssetCache

    ReplyDelete