some refactoring, now make cookie work and should be good!
slight refctor - only attacthe stuff app_conf needs to window