Fixed problem on login using cookie