Modify log in and register php file

set session to be used as keeping track of register state