fix encryption and cookies