login and add cookie