Cookie - module

make cookie functionality into a module. I tried all programs and it works (at least as well as the Development branch works)