Add some flash stuff, and make cookie handling better