New changes on login functio, cookies added