Fixed registration bugs, implemented login cookies