clean logic for errMsg in register
finish register validation
add error msg to header for register, and increase session time
add session close redirect