login using sessions works on index and login pages