finished authentication
Implemented cookie factory