fix cookie path
move function to function file
repair old passwords
remove unused query