Reputation: 337
I am trying to clear flash cookies for a SWF that is hosted on my domain. Is it possible to get this flash cookie (sharedObject) so that it can be cleared? visiting this page shows my domain in the list of sites, but I want to be able to clear these from another SWF file which is drawn if the cookies are to be reset. Any help is appreciated!
Upvotes: 0
Views: 177
Reputation: 52153
You can do this using SharedObject/clear()
with some limitations:
"/"
as the path so that all SWFs on the domain can access the shared object. The default path limits access to only the SWF that created the shared object.For example:
domain.com/my/path/writer1.swf
var so:SharedObject = SharedObject.getLocal("savedData1", "/");
so.data.something = "Something";
domain.com/my/other/writer2.swf
var so:SharedObject = SharedObject.getLocal("savedData2", "/");
so.data.stuff = "Stuff";
domain.com/other/thing/writer3.swf
var so:SharedObject = SharedObject.getLocal("savedData3", "/");
so.data.thing = "Thing";
domain.com/eraser.swf
SharedObject.getLocal("savedData1", "/").clear();
SharedObject.getLocal("savedData2", "/").clear();
SharedObject.getLocal("savedData3", "/").clear();
or
var sharedObjectNames:Array = ["savedData1", "savedData2", "savedData3"];
for each(var sharedObjectName:String in sharedObjectNames){
SharedObject.getLocal(sharedObjectName, "/").clear();
}
Note that when you use "/"
as the path you must be careful not to have name collisions.
Upvotes: 2