complete login logout function, can hold session in backend.still some bugs in register